“Application stopped working” after enabling Proguard

﹥>﹥吖頭↗ 提交于 2019-12-03 10:58:46

The stack trace shows that ActionBarSherlock is failing to find a constructor "a(Activity,int)" using reflection. Its documentation indeed specifies that each extension of ActionBarSherlock should have such a constructor. ProGuard doesn't (can't) know this and has removed the constructor, because it appears unused in the code. You therefore have to explicitly tell ProGuard to keep it:

-keepclassmembers class * extends com.actionbarsherlock.ActionBarSherlock {
    <init>(android.app.Activity, int);
}

In general, if you get such stack traces related to reflection in your code or its libraries, you need to add corresponding configuration.

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