简体   繁体   中英

Class not found on Release Build

So I have a multi module project, with App Module implement from feature module and not implementing model module. Everything works fine on Debug Build but not on Release Build with Minify Enabled on App Module. On Release Build I kept getting exception like this:

Caused by java.lang.ClassNotFoundException: com.lelestacia.lelenimexml.core.model.anime.Anime

Anime is a model class in Model Module, which is not being used by App Module. But in Release Build and minify enabled on App Module, this keep happening. But, everything is Normal if Minify is disabled on App Module.

Here is my repository: Github Repository

Add @Keep right before the class definition. This prevents Proguard/R8 minification from removing the class from the release build. This is sometimes required for classes that you never instantiate except through reflection (and maybe parceling).

@Keep
@Parcelize
data class Anime(
    //...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM