Proguard causing runtime exception with Android Navigation Component

南笙酒味 提交于 2019-12-04 04:41:32
Kayvan N

I know that Proguard and R8 should be keeping all the children of library classes but in this case, the fragment class seems to be missing. This keep rule solved my issue but technically we should not need this rule at all!

-keep class * extends android.support.v4.app.Fragment{}

If you are using AndroidX, then use this rule: -keep class * extends androidx.fragment.app.Fragment{}

Also note, if you use argType in your navigation XML, then you currently also need a rule for that, for example: -keep class com.example.model.MyModel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!