Android app crashes when Proguard is enabled

前端 未结 3 998
后悔当初
后悔当初 2021-01-19 21:26

Every time I Export Signed Application from eclipse and install the apk file onto my phone, the app would crash. This only happens with Proguard enabled.

Here is my

相关标签:
3条回答
  • 2021-01-19 22:10

    I finally solved it. This is what I forgot to add to my Proguard file. The getters and setters.

    -keep public class com.example.YourModelClassName {
      public *** get*();
      public void set*(***);
    } 
    
    0 讨论(0)
  • 2021-01-19 22:18

    Just add -keep class com.firebase.**{ *; } in your proguard-rules.pro file.

    0 讨论(0)
  • 2021-01-19 22:24

    I would venture to guess something in your app is using Java reflection to instantiate a class.

    It appears whatever class this is has been name-mangled by proguard.

    You'll have to figure out which one and add an exception rule for it.

    You can make use of the mapping file proguard creates to figure out which class and method is being used in the exception. The file is located in build/outputs/proguard/release/mapping.txt

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