我正在尝试使用Proguard构建应用程序并使用以下代码进行proguard -
-dontwarn android.support.**
-dontwarn org.kobjects.**
-dontwarn org.ksoap2.**
-dontwarn org.kxml2.**
-dontwarn org.xmlpull.**
-optimizationpasses 25
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic
-keep public class * extends android.app
#-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 com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-assumenosideeffects class java.lang.System {
public static *** d(...);
public static *** v(...);
public static *** e(...);
public static *** i(...);
public static *** w(...);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
在构建时我遇到了以下错误 -
[2014-08-26 15:45:45 - MyProject] Proguard returned with error code 1. See console
[2014-08-26 15:45:45 - MyProject] Note: there were 4 duplicate class definitions.
[2014-08-26 15:45:45 - MyProject] You should check if you need to specify additional program jars.
[2014-08-26 15:45:45 - MyProject] java.lang.UnsupportedOperationException: Method must be overridden in [proguard.optimize.peephole.ClassMerger] if ever called
[2014-08-26 15:45:45 - MyProject] at proguard.classfile.util.SimplifiedVisitor.visitAnyClass(SimplifiedVisitor.java:47)
[2014-08-26 15:45:45 - MyProject] at proguard.classfile.util.SimplifiedVisitor.visitLibraryClass(SimplifiedVisitor.java:59)
[2014-08-26 15:45:45 - MyProject] at proguard.classfile.LibraryClass.accept(LibraryClass.java:301)
[2014-08-26 15:45:45 - MyProject] at proguard.classfile.ProgramClass.subclassesAccept(ProgramClass.java:433)
[2014-08-26 15:45:45 - MyProject] at proguard.optimize.peephole.VerticalClassMerger.visitProgramClass(VerticalClassMerger.java:83)
[2014-08-26 15:45:45 - MyProject] at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
[2014-08-26 15:45:45 - MyProject] at proguard.classfile.ClassPool.classesAccept(ClassPool.java:116)
[2014-08-26 15:45:45 - MyProject] at proguard.optimize.Optimizer.execute(Optimizer.java:565)
[2014-08-26 15:45:45 - MyProject] at proguard.ProGuard.optimize(ProGuard.java:306)
[2014-08-26 15:45:45 - MyProject] at proguard.ProGuard.execute(ProGuard.java:115)
[2014-08-26 15:45:45 - MyProject] at proguard.ProGuard.main(ProGuard.java:492)
目前我正在使用appcompat_v7作为库,它会在创建主流活动时自动构建。
以下库用于appcompat_v7
Android私有库和Android依赖项被贡献给依赖项目
请帮帮我。提前致谢