Retrofit 2 returns null in release APK when minifyenable but ok in debug APK

你。 提交于 2019-12-03 13:29:57

Problem solved :)

No issue with proguard-rules no need to add anything extra.

Needed to add SerializedName annotation if minifyEnabled even if variable name same as key.

That was the only Model which i had created manually :P

Which works fine in Debug but not after Signed in. :)

You need to setup proguard-rule for release. If you want to test real server, you can create new build type, which targets server API

Cheers :)

I had the same problem and my solution was to modify the 'protection rules' to exclude your class from obfuscation.

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