2

私のプロジェクトは、Proguard がなくても正常に動作します。つまり、プロジェクトを実行するときに Eclipse によって生成された apk をインストールし、それを Samsung Galaxy デバイスにインストールすると、すべてうまくいきます。しかし、Proguard を使用して署名付き apk をエクスポートしようとすると、正常にエクスポートされますが、アプリケーションを実行しようとすると機能しません。エミュレーターに apk をインストールして、Logcat の例外を確認したところ、次のように返されました。

11-28 02:28:33.709: E/AndroidRuntime(853): FATAL EXCEPTION: main
11-28 02:28:33.709: E/AndroidRuntime(853): java.lang.ExceptionInInitializerError
11-28 02:28:33.709: E/AndroidRuntime(853):  at    com.actionbarsherlock.app.SherlockActivity.c(Unknown Source)
11-28 02:28:33.709: E/AndroidRuntime(853):  at com.actionbarsherlock.app.SherlockActivity.setContentView(Unknown Source)
11-28 02:28:33.709: E/AndroidRuntime(853):  at com.linxter.allaware.views.AllAwareActivity.a(Unknown Source)
11-28 02:28:33.709: E/AndroidRuntime(853):  at   com.linxter.allaware.views.StartupActivity.onCreate(Unknown Source)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.app.Activity.performCreate(Activity.java:4465)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.app.ActivityThread.access$600(ActivityThread.java:123)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.os.Handler.dispatchMessage(Handler.java:99)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.os.Looper.loop(Looper.java:137)
11-28 02:28:33.709: E/AndroidRuntime(853):  at android.app.ActivityThread.main(ActivityThread.java:4424)
11-28 02:28:33.709: E/AndroidRuntime(853):  at java.lang.reflect.Method.invokeNative(Native Method)
11-28 02:28:33.709: E/AndroidRuntime(853):  at java.lang.reflect.Method.invoke(Method.java:511)
11-28 02:28:33.709: E/AndroidRuntime(853):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-28 02:28:33.709: E/AndroidRuntime(853):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-28 02:28:33.709: E/AndroidRuntime(853):  at dalvik.system.NativeStart.main(Native Method)
11-28 02:28:33.709: E/AndroidRuntime(853): Caused by: java.lang.IllegalArgumentException: Class a is not annotated with @Implementation
11-28 02:28:33.709: E/AndroidRuntime(853):  at com.actionbarsherlock.a.a(Unknown Source)
11-28 02:28:33.709: E/AndroidRuntime(853):  at com.actionbarsherlock.a.<clinit>(Unknown Source)
11-28 02:28:33.709: E/AndroidRuntime(853):  ... 18 more

Proguard の最新バージョンであるバージョン 4.8 と、最新バージョンの ActionBarSherlock である 4.2.0 を使用しています。これは私の Proguard 構成ファイルの一部です。

-ignorewarnings
-target 1.6
-optimizationpasses 5
-printmapping mapping.txt
# -overloadaggressively
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-dump class_files.txt
-printseeds seeds.txt
-printusage unused.txt

# The -optimizations option disables some arithmetic simplifications that Dalvik 1.0 and 1.5 can't handle.
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

# Recommended configuration for ActionBarSherlock on http://actionbarsherlock.com/faq.html
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }
-keepattributes *Annotation*

# Keep classes which are entry points.
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.Application


-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
}

# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum  * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers,allowshrinking class * {
    native <methods>;
}

なにが問題ですか?助けていただければ幸いです。ありがとうございました。

4

0 に答える 0