Android studio 1.1.0 setting minifyEnabled true causing issues with app

前端 未结 2 1066
青春惊慌失措
青春惊慌失措 2021-02-05 18:56

Here\'s my gradle.build file

defaultConfig {

    minSdkVersion 15
    targetSdkVersion 21
    versionCode 2
    versionName \"1.0\"
}
buildTypes {
    release {         


        
2条回答
  •  自闭症患者
    2021-02-05 19:40

    Proguard is likely obfuscating some of your classes in your project that Retrofit/Gson is using. This results in your request never being successful because parsing fails. This is due to the parameters not matching e.g. String status may turn into String a with Proguard. This does not match the response, so it fails.

    In short - make sure all your classes that Retrofit/Gson uses for creating and parsing the response are excluded from Proguard's obfuscation.

提交回复
热议问题