开发者

Proguard:IllegalArgumentException: Value is not a reference value

开发者 https://www.devze.com 2023-03-08 01:08 出处:网络
I\'m getting a error while trying to make a Proguard version of my Android app.And I can\'t google it out.

I'm getting a error while trying to make a Proguard version of my Android app.And I can't google it out.

The error is:

Unexpected error while performing partial evaluation:
   Class       = [com/skyhookwireless/_sdkkc]
   Method      = [<clinit>()V]
   Exception   = [java.lang.IllegalArgumentException] (Stacks have different current   sizes [4] and [1])
 Unexpected error while shrinking instructions after partial evaluation:
   Class       = [com/skyhookwireless/_sdkkc]
   Method      = [<clinit>()V]
   Exception   = [java.lang.IllegalArgumentException] (Stacks have different current sizes [4] and [1])
 Not optimizing this method
 Unexpected error while evaluating instruction:
   Class       = [com/skyhookwireless/_sdklb]
   Method      = [<clinit>()V]
   Instruction = [112] ret v0
   Exception   = [java.lang.NullPointerException] (null)
 Unexpected error while performing partial evaluation:
   Class       = [com/skyhookwireless/_sdklb]
   Method      = [<clinit>()V]
   Exception   = [java.lang.NullPointerException] (null)
 Unexpected error while shrinking instructions after partial evaluation:
   Class       = [com/skyhookwireless/_sdklb]
   Method      = [<clinit>()V]
   Exception   = [java.lang.NullPointerException] (null)
 Not optimizing this method
 Unexpected error while performing partial evaluation:
   Class       = [com/skyhookwireless/_sdklc]
   Method      = [_sdka()Z]
   Exception   = [java.lang.ArrayIndexOutOfBoundsException] (17)
 Unexpected error while shrinking instructions after partial evaluation:
   Class       = [com/skyhookwireless/_sdklc]
   Method      = [_sdka()Z]
   Exception   = 开发者_StackOverflow[java.lang.ArrayIndexOutOfBoundsException] (17)
 Not optimizing this method
 Unexpected error while evaluating instruction:
   Class       = [com/skyhookwireless/wps/_sdktb]
   Method      = [<clinit>()V]
   Instruction = [12] aastore
   Exception   = [java.lang.IllegalArgumentException] (Value is not a reference value     [proguard.evaluation.value.UnknownIntegerValue])
 Unexpected error while performing partial evaluation:
   Class       = [com/skyhookwireless/wps/_sdktb]
   Method      = [<clinit>()V]
   Exception   = [java.lang.IllegalArgumentException] (Value is not a reference value [proguard.evaluation.value.UnknownIntegerValue])
 java.lang.IllegalArgumentException: Value is not a reference value [proguard.evaluation.value.UnknownIntegerValue]
    at proguard.evaluation.value.Value.referenceValue(Value.java:97)
    at proguard.evaluation.Stack.apop(Stack.java:331)
    at proguard.evaluation.Processor.visitSimpleInstruction(Processor.java:181)
    at proguard.classfile.instruction.SimpleInstruction.accept(SimpleInstruction.java:218)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:729)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:575)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:533)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateSubroutine(PartialEvaluator.java:907)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:849)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:560)
    at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:533)
    at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:221)
    at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:180)
    at proguard.optimize.evaluation.LivenessAnalyzer.visitCodeAttribute(LivenessAnalyzer.java:195)
    at proguard.optimize.evaluation.VariableOptimizer.visitCodeAttribute(VariableOptimizer.java:102)
    at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
    at proguard.classfile.ProgramMethod.attributesAccept(ProgramMethod.java:79)
    at proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember(AllAttributeVisitor.java:95)
    at proguard.classfile.util.SimplifiedVisitor.visitProgramMethod(SimplifiedVisitor.java:91)
    at proguard.classfile.ProgramMethod.accept(ProgramMethod.java:71)
    at proguard.classfile.ProgramClass.methodsAccept(ProgramClass.java:439)
    at proguard.classfile.visitor.AllMethodVisitor.visitProgramClass(AllMethodVisitor.java:47)
    at proguard.classfile.ProgramClass.accept(ProgramClass.java:281)
    at proguard.classfile.ClassPool.classesAccept(ClassPool.java:114)
    at proguard.optimize.Optimizer.execute(Optimizer.java:764)
    at proguard.ProGuard.optimize(ProGuard.java:325)
    at proguard.ProGuard.execute(ProGuard.java:114)
    at proguard.ProGuard.main(ProGuard.java:499)

I import wpsapi.jar into my project as external jar in [Project]/libs/

Here is proguard.cfg

-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-dontnote
-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>;
}

-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 *;
}


I don't know the exact reason of this problem, but I faced some strange problems when using Proguard. I switched to the last Proguard version and it solved all my problems. To change Proguard version you need to replace /tools/proguard folder with a newer Proguard version.

0

精彩评论

暂无评论...
验证码 换一张
取 消