Proguard configuration for Firebase-UI library

前端 未结 2 1495
悲&欢浪女
悲&欢浪女 2020-12-21 06:11

When creating a APK with proguard enabled, the following exception is thrown when using the FirebaseRecyclerAdapter from the Firebase-UI library (com.firebaseui:fireba

相关标签:
2条回答
  • 2020-12-21 06:51

    Solved this by moving the ViewHolder classes that are used by the FirebaseRecyclerAdapter to a dedicated package (e.g. com.mypackage.myapp.viewholders) and adding a rule within the proguard configuration to prevent that classes within this package become obfuscated by proguard:

    -keep class com.mypackage.myapp.viewholders.** { *; }
    
    0 讨论(0)
  • 2020-12-21 07:10

    Well, I had my ViewHolder inside relative FirebaseRecyclerAdapter as an inner class and gave me this error. Making the inner class has solved the problem.

    Also https://github.com/firebase/FirebaseUI-Android/issues/46#issuecomment-167373575 states same thing with an addition.

    Inner class ViewHolder must be public and static so that it could be initiated via reflection.

    0 讨论(0)
提交回复
热议问题