当使用Proguard的,你需要为每个引用的库一个单独的配置?Proguard

由网友(在下西门庆)分享简介:我的应用程序有哪些是工作空间的项目引用HoloEverywhere和SherlockActionBar,两者兼而有之。当我启用了Proguard的只有应用程序,它崩溃给这些错误:My application has references to HoloEverywhere and SherlockActionBar,...

我的应用程序有哪些是工作空间的项目引用HoloEverywhere和SherlockActionBar,两者兼而有之。当我启用了Proguard的只有应用程序,它崩溃给这些错误:

My application has references to HoloEverywhere and SherlockActionBar, both which are in-workspace projects. When I enabled Proguard for the application only, it crashes giving these errors:

11-15 11:50:11.090: E/AndroidRuntime(24823): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
11-15 11:50:11.090: E/AndroidRuntime(24823):    at com.actionbarsherlock.a.a(Unknown Source)
11-15 11:50:11.090: E/AndroidRuntime(24823):    at org.holoeverywhere.a.a.l(Unknown Source)
11-15 11:50:11.090: E/AndroidRuntime(24823):    at org.holoeverywhere.a.a.setContentView(Unknown Source)

这是因为我才启用Proguard的的应用程序,而不是其他的工作空间项目HE和ABS?

Is this because I only enabled Proguard for the app and not the other in-workspace projects HE and ABS?

我使用的是默认的ProGuard-project.txt在SDK中,并没有添加任何其他规则。

I am using the default proguard-project.txt in the sdk and did not add any additional rules.

推荐答案

没有你不知道。

使用这些规则,以保持引用的类未混淆。

Use these rules to keep the referenced classes un-obfuscated.

-keep class com.actionbarsherlock.** {*;}
-keep class org.holoeverywhere.** {*;}
阅读全文

相关推荐

最新文章