Proguard:IllegalArgumentException:堆栈具有不同的当前大小
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 catch 块。
我用 proguard 4.5、4.6 和 4.7 尝试过,但都失败了。
有什么想法吗?
谢谢
Proguard is crashing with "Proguard returned with error code 1", and this crash in the console:
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)
I have narrowed it down to a try catch block for an IOException. If I comment out that try catch block then it shows this error for another IOException try catch block elsewhere in the app. If I comment that one out, then it successfully builds.
So in both places proguard seems to be crashing on an IOException try catch block. These blocks have been in the code in previous builds that went through proguard without any trouble before.
Also, there are other IOException catch blocks that don't give any errors.
I tried this with proguard 4.5, 4.6, and 4.7 and all failed.
Any ideas?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这似乎是 ProGuard 中的一个错误。您可以将其登录到 ProGuard 的 bug 跟踪器,最好使用小测试用例,允许我重现问题,或者您可以 邮件 对我来说(Eric,ProGuard 的开发者)。
目前,您可以通过关闭优化(使用选项
-dontoptimize
)来解决该问题。This appears to be a bug in ProGuard. You can log it on ProGuard's bug tracker, preferably with a small test case that allows me to reproduce the problem, or you can mail it to me (Eric, developer of ProGuard).
For the time being, you can work around the problem by switching off optimization (with the option
-dontoptimize
).我在 xamarin forms 项目上的 proguard 5.3.3 中收到此错误。我的问题是我的 proguard 文件夹中缺少文件,因为当您从他们的网站下载 proguard 版本时,下载的 zip 中没有这些 txt 文件。最好备份旧的混淆器并从那里复制这些文件,或者我相信您可以手动创建。
I was getting this error for proguard 5.3.3 on xamarin forms project. my problem was i was having files missing in my proguard folder because when you download a version of proguard from their website, you dont have these txt files in the downloaded zip. It is always better to backup your old proguard and copy these files from there or you can just create manually I believe.