Android, ProGuard, and keepclasseswithmembernames

倾然丶 夕夏残阳落幕 提交于 2019-11-30 09:16:17

The configuration in the Android SDK (at least up to version 11) is not entirely correct, indeed.

The configuration for Android in the ProGuard documentation correctly specifies "-keepclasseswithmembers", not "-keepclasseswithmembernames".

When I first tried the integrated proguard with Ant, my app kept crashing with runtime errors on the clickhandlers. (I always set these in XML). I assumed I must be doing something wrong, couldn't work out what, so added the line

-dontshrink

at the top of the proguard.cfg.

Maybe this isn't optimal but it stopped the run time errors!

Addendum

In fact I checked this by looking at usage.txt. The clickhandlers were listed in there before I added the dontshrink option, after I added it, usage.txt was empty as would be expected.

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