Android Proguard - ClassNotFoundException

前端 未结 2 1612
轻奢々
轻奢々 2020-12-19 10:44

I enabled proguard for my android app. I can build the project successfully but it crashes on startup with classNotFoundException. It doesn\'t even find the launcher activit

2条回答
  •  时光取名叫无心
    2020-12-19 11:18

    Remove the obfuscation rules related to activity and all also related to support libaries.Android studio by default has those templates.You could enable them by adding this rule in your gradle

    buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt')
            }
        }
    

    Also please edit the rule for Jackson processor

    -keep public class your.class.** {
      public void set*(***);
      public *** get*();
    }
    

    In this your class.** is the POJO(getter/setter) class that you have created for parsing your response

提交回复
热议问题