与proguard整合时获得力量关闭?

时间:2013-09-11 06:25:17

标签: android actionbarsherlock proguard

我在我的应用中使用了三个库

    AndroidsupportV4.
    Picasso
    ActionBarSherlock
项目属性中的

我添加了这个

  proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

       # Project target.
  target=android-18
android.library=false
android.library.reference.1=../JakeWharton-

ActionBarSherlock-e5c2d1c /文库

在proguard-project.txt中我添加了这个

       -dontwarn com.squareup.picasso.**

我的日志猫

09-11 12:25:06.695: E/AndroidRuntime(26629): FATAL EXCEPTION: main
09-11 12:25:06.695: E/AndroidRuntime(26629): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.phoneix.allu/com.phoneix.allu.HomeActivity}: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.app.ActivityThread.access$600(ActivityThread.java:127)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.os.Handler.dispatchMessage(Handler.java:99)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.os.Looper.loop(Looper.java:137)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.app.ActivityThread.main(ActivityThread.java:4441)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at java.lang.reflect.Method.invokeNative(Native Method)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at java.lang.reflect.Method.invoke(Method.java:511)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at dalvik.system.NativeStart.main(Native Method)
09-11 12:25:06.695: E/AndroidRuntime(26629): Caused by: java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
09-11 12:25:06.695: E/AndroidRuntime(26629):    at com.actionbarsherlock.a.a(Unknown Source)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at com.actionbarsherlock.a.f.a(Unknown Source)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at com.actionbarsherlock.a.f.setContentView(Unknown Source)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at com.phoneix.allu.HomeActivity.onCreate(Unknown Source)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.app.Activity.performCreate(Activity.java:4465)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
09-11 12:25:06.695: E/AndroidRuntime(26629):    ... 11 more
09-11 12:25:06.695: E/AndroidRuntime(26629): Caused by: java.lang.NoSuchMethodException: <init> [class android.app.Activity, int]
09-11 12:25:06.695: E/AndroidRuntime(26629):    at java.lang.Class.getConstructorOrMethod(Class.java:460)
09-11 12:25:06.695: E/AndroidRuntime(26629):    at java.lang.Class.getConstructor(Class.java:431)
09-11 12:25:06.695: E/AndroidRuntime(26629):    ... 18 more

1 个答案:

答案 0 :(得分:1)

还要将以下内容添加到proguard-android.txt文件中:

-keep class com.actionbarsherlock.** {*;}