导出android项目时出现Proguard错误

时间:2013-07-02 14:46:50

标签: android eclipse exception proguard osmdroid

我试图在Eclipse中从项目(Osmand)导出android应用程序,问题是proguard返回了错误代码1.之前它抛出了多个警告,所以我用了#34; -dontwarn&#34 ;命令。现在控制台就是这样:

Proguard returned with error code 1. See console
Note: there were 227 duplicate class definitions.
You should check if you need to specify additional program jars.
Unexpected error while evaluating instruction:
    Class       = [com/actionbarsherlock/app/SherlockFragmentActivity]
    Method      = [getSherlock()Lcom/actionbarsherlock/ActionBarSherlock;]
    Instruction = [10] invokestatic #36
    Exception   = [java.lang.IllegalArgumentException] (Can't find common super class     of [android/app/Activity] (with 11 known super classes) and     [com/actionbarsherlock/app/SherlockFragmentActivity] (with 6 known super classes))
Unexpected error while performing partial evaluation:
    Class       = [com/actionbarsherlock/app/SherlockFragmentActivity]
    Method      = [getSherlock()Lcom/actionbarsherlock/ActionBarSherlock;]
    Exception   = [java.lang.IllegalArgumentException] (Can't find common super class of [android/app/Activity] (with 11 known super classes) and [com/actionbarsherlock/app/SherlockFragmentActivity] (with 6 known super classes))
java.lang.IllegalArgumentException: Can't find common super class of [android/app/Activity] (with 11 known super classes) and [com/actionbarsherlock/app/SherlockFragmentActivity] (with 6 known super classes)
...   

Proguard配置文件:

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*

-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-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.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService

-keepclasseswithmembernames class * {
    native <methods>;
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet);
}

-keepclasseswithmembers class * {
    public <init>(android.content.Context, android.util.AttributeSet, int);
}

-keepclassmembers class * extends android.app.Activity {
   public void *(android.view.View);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
      public static final android.os.Parcelable$Creator *;
}


#this part was added:
-dontwarn android.support.v4.app.Watson
-dontwarn com.actionbarsherlock.**
-dontwarn com.dropbox.client2.**
-dontwarn net.osmand.plus.activities.search.**
-dontwarn net.osmand.plus.activities.NavigatePointFragment
-dontwarn net.osmand.plus.activities.FavouritesListFragment
-dontwarn net.osmand.plus.activities.FavouritesListActivity
-dontwarn net.osmand.plus.activities.FavouritesListFragment$FavouritesAdapter

我该怎么办?

0 个答案:

没有答案