androidproguardadsadcolony

AdColony proguard error


I include AdColony in my android app and now I am trying to export my app with proguard. I found configuration for AdColony here and here. I tried to include them separately and together into proguard.cfg, but it doesn't work.

Configurations:

-dontwarn android.webkit.**
# another config
-dontwarn com.jirbo.adcolony.**
-keep class com.jirbo.adcolony.**{*;}

Proguard says:

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)

My proguard.cfg file:

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

-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable

# http://stackoverflow.com/questions/4525661/android-proguard-cant-find-dynamically-referenced-class-javax-swing
-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.**    

What am I doing wrong?


Solution

  • I don't like the solution I found by myself, but it's better than nothing. In the current moment I am using version 2.2.2. I began to test earlier versions of this library and found out that version 2.1.3 works as appropriate. Now my app is exported successfully. Sometimes, improvements lead to the generation of new bugs.