App Crashing With Proguard Enabled

筅森魡賤 提交于 2019-12-18 16:51:53

问题


My app runs perfectly without proguard enabled but when I enable it the app crashes right away. I have tried many combinations in the configuration to no avail.

Is there something that I should be keeping that I'm missing?

proguard config: https://gist.github.com/hanleyhansen/99fc07807950bae8e4f5

Unobfuscated log: https://gist.github.com/hanleyhansen/6cba7fc941a79d85802f

onSuccess(): https://gist.github.com/hanleyhansen/e7a4916c42d3ca065c99


回答1:


I found the offending code. I changed my Proguard.cfg to match the following:

https://github.com/google/gson/blob/9f8ace9ac4c56b82eba1bbd8b44f80e042bda7e0/examples/android-proguard-example/proguard.cfg

And now everything is working!




回答2:


Usually proguard removes few classes if they are not explicitly set as

-keepclassmembers ....

But such errors are shown as classNotFound, NoSuchMethodException etc..,

Anyways decode the log cat you got using this and check what actually caused the NPE.



来源:https://stackoverflow.com/questions/16243550/app-crashing-with-proguard-enabled

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