【问题标题】:Proguard: IllegalArgumentException: Stacks have different current sizesProguard:IllegalArgumentException:堆栈具有不同的当前大小
【发布时间】:2012-02-14 18:12:44
【问题描述】:

Proguard 因“Proguard 返回错误代码 1”而崩溃,控制台中出现此崩溃:

java.lang.IllegalArgumentException: Stacks have different current sizes [0] and [1]
at proguard.evaluation.Stack.generalize(Stack.java:125)
at proguard.evaluation.TracedStack.generalize(TracedStack.java:140)
at proguard.optimize.evaluation.PartialEvaluator.evaluateSingleInstructionBlock(PartialEvaluator.java:683)
at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlock(PartialEvaluator.java:587)
at proguard.optimize.evaluation.PartialEvaluator.visitExceptionInfo(PartialEvaluator.java:1078)
at proguard.classfile.visitor.ExceptionHandlerFilter.visitExceptionInfo(ExceptionHandlerFilter.java:67)
at proguard.classfile.attribute.CodeAttribute.exceptionsAccept(CodeAttribute.java:186)
at proguard.optimize.evaluation.PartialEvaluator.evaluateExceptionHandlers(PartialEvaluator.java:1018)
at proguard.optimize.evaluation.PartialEvaluator.evaluateInstructionBlockAndExceptionHandlers(PartialEvaluator.java:567)
at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute0(PartialEvaluator.java:264)
at proguard.optimize.evaluation.PartialEvaluator.visitCodeAttribute(PartialEvaluator.java:181)
at proguard.optimize.evaluation.LivenessAnalyzer.visitCodeAttribute(LivenessAnalyzer.java:205)
at proguard.optimize.evaluation.VariableOptimizer.visitCodeAttribute(VariableOptimizer.java:105)
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: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:833)
at proguard.ProGuard.optimize(ProGuard.java:306)
at proguard.ProGuard.execute(ProGuard.java:115)
at proguard.ProGuard.main(ProGuard.java:492)

我已将其缩小为 IOException 的 try catch 块。如果我注释掉 try catch 块,那么它会在应用程序的其他地方显示另一个 IOException try catch 块的错误。如果我将其注释掉,那么它会成功构建。

所以在这两个地方,proguard 似乎都在 IOException try catch 块上崩溃。这些块已经在以前的构建中的代码中,之前通过 proguard 没有任何问题。

此外,还有其他 IOException 捕获块不会给出任何错误。

我在 proguard 4.5、4.6 和 4.7 上试过这个,但都失败了。

有什么想法吗?

谢谢

【问题讨论】:

    标签: android proguard


    【解决方案1】:

    这似乎是 ProGuard 中的一个错误。您可以在ProGuard's bug tracker 上登录,最好使用允许我重现问题的小型测试用例,或者您可以mail it 给我(Eric,ProGuard 的开发人员)。

    目前,您可以通过关闭优化(使用选项-dontoptimize)来解决此问题。

    【讨论】:

    • 首先,非常感谢proguard,它真的很棒且易于使用。我继续提交了一个错误。为了使这个堆栈溢出帖子完整,这里是链接sourceforge.net/tracker/…再次感谢。
    • ProGuard 5.2.1 版仍然会发生这种情况 :-(
    • 5.3.3 也是。这里的解决方案是什么?
    【解决方案2】:

    我在 xamarin 表单项目中遇到了 proguard 5.3.3 的此错误。我的问题是我的 proguard 文件夹中缺少文件,因为当您从他们的网站下载 proguard 版本时,下载的 zip 中没有这些 txt 文件。最好备份旧的 proguard 并从那里复制这些文件,或者我相信你可以手动创建。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-04-10
      • 2023-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多