AdColony proguard 错误
AdColony proguard error
我在我的 android 应用程序中包含 AdColony
,现在我正尝试使用混淆器导出我的应用程序。我找到了 AdColony
here and here 的配置。我试图将它们分别和一起包含在 proguard.cfg 中,但它不起作用。
配置:
-dontwarn android.webkit.**
# another config
-dontwarn com.jirbo.adcolony.**
-keep class com.jirbo.adcolony.**{*;}
Proguard 说:
Proguard returned with error code 1. See console
Proguard Error 1
Output:
Unexpected error while performing partial evaluation:
Class = [com/immersion/hapticmediasdk/HapticContentSDK]
Method = [bБ04110411Б04110411()I]
Exception = [java.lang.ArrayIndexOutOfBoundsException] (-1)
java.lang.ArrayIndexOutOfBoundsException: -1
at proguard.optimize.peephole.BranchTargetFinder.visitConstantInstruction(BranchTargetFinder.java:492)
at proguard.classfile.instruction.ConstantInstruction.accept(ConstantInstruction.java:157)
at proguard.classfile.attribute.CodeAttribute.instructionsAccept(CodeAttribute.java:138)
at proguard.classfile.attribute.CodeAttribute.instructionsAccept(CodeAttribute.java:110)
at proguard.optimize.peephole.BranchTargetFinder.visitCodeAttribute(BranchTargetFinder.java:354)
at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:261)
at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:181)
at proguard.optimize.info.ParameterUsageMarker.visitCodeAttribute(ParameterUsageMarker.java:176)
at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:79)
at proguard.optimize.info.ParameterUsageMarker.visitProgramMethod(ParameterUsageMarker.java:136)
at proguard.optimize.OptimizationInfoMemberFilter.visitProgramMethod(OptimizationInfoMemberFilter.java:81)
at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:71)
at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:504)
at proguard.classfile.visitor.AllMethodVisitor.visitProgramClass(AllMethodVisitor.java:47)
at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
at proguard.classfile.ClassPool.classesAccept(ClassPool.java:116)
at proguard.optimize.Optimizer.execute(Optimizer.java:341)
at proguard.ProGuard.optimize(ProGuard.java:306)
at proguard.ProGuard.execute(ProGuard.java:115)
at proguard.ProGuard.main(ProGuard.java:492)
我的 proguard.cfg 文件:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
#
-dontwarn java.awt.**
-dontnote java.awt.**
-dontwarn com.badlogic.gdx.jnigen.**
-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
# Google Play Billing
-keep class com.android.vending.billing.**
-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 *;
}
-keepnames class com.badlogic.gdx.backends.android.AndroidInput*
-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {<init>(...);}
#GOOGLE PLAY SERVICES
-keep class com.google.** { *;}
-keep interface com.google.** { *;}
-dontwarn com.google.**
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-keepattributes *Annotation*,Signature
-keep class * extends com.google.api.client.json.GenericJson {*;}
-keep class com.google.api.services.drive.** {*;}
# AdColony
-dontwarn android.webkit.**
我做错了什么?
我不喜欢自己找到的解决方案,但总比没有好。目前我使用的是 版本 2.2.2。我开始测试这个库的早期版本,发现 version 2.1.3 可以正常工作。现在我的应用程序已成功导出。有时,改进会导致新错误的产生。
我在我的 android 应用程序中包含 AdColony
,现在我正尝试使用混淆器导出我的应用程序。我找到了 AdColony
here and here 的配置。我试图将它们分别和一起包含在 proguard.cfg 中,但它不起作用。
配置:
-dontwarn android.webkit.**
# another config
-dontwarn com.jirbo.adcolony.**
-keep class com.jirbo.adcolony.**{*;}
Proguard 说:
Proguard returned with error code 1. See console
Proguard Error 1
Output:
Unexpected error while performing partial evaluation:
Class = [com/immersion/hapticmediasdk/HapticContentSDK]
Method = [bБ04110411Б04110411()I]
Exception = [java.lang.ArrayIndexOutOfBoundsException] (-1)
java.lang.ArrayIndexOutOfBoundsException: -1
at proguard.optimize.peephole.BranchTargetFinder.visitConstantInstruction(BranchTargetFinder.java:492)
at proguard.classfile.instruction.ConstantInstruction.accept(ConstantInstruction.java:157)
at proguard.classfile.attribute.CodeAttribute.instructionsAccept(CodeAttribute.java:138)
at proguard.classfile.attribute.CodeAttribute.instructionsAccept(CodeAttribute.java:110)
at proguard.optimize.peephole.BranchTargetFinder.visitCodeAttribute(BranchTargetFinder.java:354)
at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:261)
at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:181)
at proguard.optimize.info.ParameterUsageMarker.visitCodeAttribute(ParameterUsageMarker.java:176)
at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:79)
at proguard.optimize.info.ParameterUsageMarker.visitProgramMethod(ParameterUsageMarker.java:136)
at proguard.optimize.OptimizationInfoMemberFilter.visitProgramMethod(OptimizationInfoMemberFilter.java:81)
at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:71)
at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:504)
at proguard.classfile.visitor.AllMethodVisitor.visitProgramClass(AllMethodVisitor.java:47)
at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
at proguard.classfile.ClassPool.classesAccept(ClassPool.java:116)
at proguard.optimize.Optimizer.execute(Optimizer.java:341)
at proguard.ProGuard.optimize(ProGuard.java:306)
at proguard.ProGuard.execute(ProGuard.java:115)
at proguard.ProGuard.main(ProGuard.java:492)
我的 proguard.cfg 文件:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
#
-dontwarn java.awt.**
-dontnote java.awt.**
-dontwarn com.badlogic.gdx.jnigen.**
-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
# Google Play Billing
-keep class com.android.vending.billing.**
-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 *;
}
-keepnames class com.badlogic.gdx.backends.android.AndroidInput*
-keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {<init>(...);}
#GOOGLE PLAY SERVICES
-keep class com.google.** { *;}
-keep interface com.google.** { *;}
-dontwarn com.google.**
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-keepattributes *Annotation*,Signature
-keep class * extends com.google.api.client.json.GenericJson {*;}
-keep class com.google.api.services.drive.** {*;}
# AdColony
-dontwarn android.webkit.**
我做错了什么?
我不喜欢自己找到的解决方案,但总比没有好。目前我使用的是 版本 2.2.2。我开始测试这个库的早期版本,发现 version 2.1.3 可以正常工作。现在我的应用程序已成功导出。有时,改进会导致新错误的产生。