Proguard returned with error code 1. See console
[2013-04-04 16:25:20 - ] Note: there were 157 duplicate class definitions.
[2013-04-04 16:25:20 - ] Error: Method must be overridden in [proguard.optimize.peephole.ClassMerger] if ever called
我已经尝试了在SO上找到的所有可能的解决方案。大约有2000个副本,现在减少到157个。我在我的项目中也有一些外部罐子。这是我的proguard.cfg文件:
-dontwarn android.support.**
-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.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*(...);
}
-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.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}
-keepclassmembers class * implements android.os.Parcelable {
static android.os.Parcelable$Creator CREATOR;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-keep class com.flurry.** { *; }
-dontwarn com.flurry.**
-keep class org.apache.** { *; }
-dontwarn org.apache.**
-dump proguard/class_files.txt
-printseeds proguard/seeds.txt
-printusage proguard/unused.txt
-printmapping proguard/mapping.txt
此应用程序适用于Android 4.0你能让我知道是什么原因造成的,我怎么去解决它。
将我的项目的proguard配置与${sdk.dir}/tools/proguard/proguard-android.txt中的proguard配置合并就成功了。
此错误主要发生在第三方构建系统(例如Maven)上,它们不知道默认的proguard配置。
乌利希期刊指南:…因为默认配置的以下内容:
# Optimization is turned off by default. Dex does not like code run
# through the ProGuard optimize and preverify steps (and performs some
# of these optimizations on its own).
-dontoptimize