Solving the problem of confusing errors-the solution to the problem of packaging the signature

Source: Internet
Author: User

This problem is more annoying, mainly because of the use of laser push function, and then packaged files released apk when there is a problem, resulting in the following a lot of errors, but we do not worry, there is a solution.
[2013-11-28 13:17:19-sjh_android] Proguard returned with error code 1. See console
[2013-11-28 13:17:19-sjh_android] Note:there were 426 duplicate class definitions.
[2013-11-28 13:17:19-sjh_android] You should the check if you need to specify additional program jars.
[2013-11-28 13:17:19-sjh_android] Unexpected error while computing stack sizes:
[2013-11-28 13:17:19-sjh_android] Class = [Cn/jpush/android/api/instrumentedactivity]
[2013-11-28 13:17:19-sjh_android] Method = [() V]
[2013-11-28 13:17:19-sjh_android] Exception = [Java.lang.IllegalArgumentException] (Stack size becomes negative

After instruction [] invokevirtual #57 in [Cn/jpush/android/api/instrumentedactivity. () V])
[2013-11-28 13:17:19-sjh_android] Unexpected error while editing code:
[2013-11-28 13:17:19-sjh_android] Class = [Cn/jpush/android/api/instrumentedactivity]
[2013-11-28 13:17:19-sjh_android] Method = [() V]
[2013-11-28 13:17:19-sjh_android] Exception = [Java.lang.IllegalArgumentException] (Stack size becomes negative

After instruction [] invokevirtual #57 in [Cn/jpush/android/api/instrumentedactivity. () V])
[2013-11-28 13:17:19-sjh_android] java.lang.IllegalArgumentException:Stack size becomes negative after instruction

[Invokevirtual] #57 in [Cn/jpush/android/api/instrumentedactivity. () V
[2013-11-28 13:17:19-sjh_android] at

Proguard.classfile.attribute.visitor.StackSizeComputer.evaluateInstructionBlock (stacksizecomputer.java:334)
[2013-11-28 13:17:19-sjh_android] at

Proguard.classfile.attribute.visitor.StackSizeComputer.visitBranchInstruction (stacksizecomputer.java:197)
[2013-11-28 13:17:19-sjh_android] at proguard.classfile.instruction.BranchInstruction.accept

(branchinstruction.java:140)
[2013-11-28 13:17:19-sjh_android] at

Proguard.classfile.attribute.visitor.StackSizeComputer.evaluateInstructionBlock (stacksizecomputer.java:355)
[2013-11-28 13:17:19-sjh_android] at

Proguard.classfile.attribute.visitor.StackSizeComputer.visitCodeAttribute0 (stacksizecomputer.java:153)
[2013-11-28 13:17:19-sjh_android] at Proguard.classfile.attribute.visitor.StackSizeComputer.visitCodeAttribute

(stacksizecomputer.java:110)
[2013-11-28 13:17:19-sjh_android] at Proguard.classfile.editor.StackSizeUpdater.visitCodeAttribute

(stacksizeupdater.java:49)
[2013-11-28 13:17:19-sjh_android] at Proguard.classfile.editor.CodeAttributeEditor.visitCodeAttribute0

(codeattributeeditor.java:376)
[2013-11-28 13:17:19-sjh_android] at Proguard.classfile.editor.CodeAttributeEditor.visitCodeAttribute

(codeattributeeditor.java:311)
[2013-11-28 13:17:19-sjh_android] at Proguard.optimize.DuplicateInitializerInvocationFixer.visitCodeAttribute

(duplicateinitializerinvocationfixer.java:92)
[2013-11-28 13:17:19-sjh_android] at proguard.classfile.attribute.CodeAttribute.accept (codeattribute.java:101)
[2013-11-28 13:17:19-sjh_android] at proguard.classfile.ProgramMethod.attributesAccept (programmethod.java:79)
[2013-11-28 13:17:19-sjh_android] at

Proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember (allattributevisitor.java:95)
[2013-11-28 13:17:19-sjh_android] at Proguard.classfile.util.SimplifiedVisitor.visitProgramMethod

(simplifiedvisitor.java:91)
[2013-11-28 13:17:19-sjh_android] at proguard.classfile.ProgramMethod.accept (programmethod.java:71)
[2013-11-28 13:17:19-sjh_android] at proguard.classfile.ProgramClass.methodsAccept (programclass.java:504)
[2013-11-28 13:17:19-sjh_android] at Proguard.classfile.visitor.AllMethodVisitor.visitProgramClass

(allmethodvisitor.java:47)
[2013-11-28 13:17:19-sjh_android] at proguard.classfile.ProgramClass.accept (programclass.java:346)
[2013-11-28 13:17:19-sjh_android] at proguard.classfile.ClassPool.classesAccept (classpool.java:116)
[2013-11-28 13:17:19-sjh_android] at Proguard.optimize.Optimizer.execute (optimizer.java:500)
[2013-11-28 13:17:19-sjh_android] at Proguard. Proguard.optimize (proguard.java:306)
[2013-11-28 13:17:19-sjh_android] at Proguard. Proguard.execute (proguard.java:115)
[2013-11-28 13:17:19-sjh_android] at Proguard. Proguard.main (proguard.java:492)
[2013-11-28 13:20:10-sjh_android] Proguard returned with error code 1. See console
[2013-11-28 13:20:10-sjh_android] Note:there were 426 duplicate class definitions.
[2013-11-28 13:20:10-sjh_android] You should the check if you need to specify additional program jars.
[2013-11-28 13:20:10-sjh_android] Unexpected error while computing stack sizes:
[2013-11-28 13:20:10-sjh_android] Class = [Cn/jpush/android/api/instrumentedactivity]
[2013-11-28 13:20:10-sjh_android] Method = [() V]
[2013-11-28 13:20:10-sjh_android] Exception = [Java.lang.IllegalArgumentException] (Stack size becomes negative

After instruction [] invokevirtual #57 in [Cn/jpush/android/api/instrumentedactivity. () V])
[2013-11-28 13:20:10-sjh_android] Unexpected error while editing code:
[2013-11-28 13:20:10-sjh_android] Class = [Cn/jpush/android/api/instrumentedactivity]
[2013-11-28 13:20:10-sjh_android] Method = [() V]
[2013-11-28 13:20:10-sjh_android] Exception = [Java.lang.IllegalArgumentException] (Stack size becomes negative

After instruction [] invokevirtual #57 in [Cn/jpush/android/api/instrumentedactivity. () V])
[2013-11-28 13:20:10-sjh_android] java.lang.IllegalArgumentException:Stack size becomes negative after instruction

[Invokevirtual] #57 in [Cn/jpush/android/api/instrumentedactivity. () V
[2013-11-28 13:20:10-sjh_android] at

Proguard.classfile.attribute.visitor.StackSizeComputer.evaluateInstructionBlock (stacksizecomputer.java:334)
[2013-11-28 13:20:10-sjh_android] at

Proguard.classfile.attribute.visitor.StackSizeComputer.visitBranchInstruction (stacksizecomputer.java:197)
[2013-11-28 13:20:10-sjh_android] at proguard.classfile.instruction.BranchInstruction.accept

(branchinstruction.java:140)
[2013-11-28 13:20:10-sjh_android] at

Proguard.classfile.attribute.visitor.StackSizeComputer.evaluateInstructionBlock (stacksizecomputer.java:355)
[2013-11-28 13:20:10-sjh_android] at

Proguard.classfile.attribute.visitor.StackSizeComputer.visitCodeAttribute0 (stacksizecomputer.java:153)
[2013-11-28 13:20:10-sjh_android] at Proguard.classfile.attribute.visitor.StackSizeComputer.visitCodeAttribute

(stacksizecomputer.java:110)
[2013-11-28 13:20:10-sjh_android] at Proguard.classfile.editor.StackSizeUpdater.visitCodeAttribute

(stacksizeupdater.java:49)
[2013-11-28 13:20:10-sjh_android] at Proguard.classfile.editor.CodeAttributeEditor.visitCodeAttribute0

(codeattributeeditor.java:376)
[2013-11-28 13:20:10-sjh_android] at Proguard.classfile.editor.CodeAttributeEditor.visitCodeAttribute

(codeattributeeditor.java:311)
[2013-11-28 13:20:10-sjh_android] at Proguard.optimize.DuplicateInitializerInvocationFixer.visitCodeAttribute

(duplicateinitializerinvocationfixer.java:92)
[2013-11-28 13:20:10-sjh_android] at proguard.classfile.attribute.CodeAttribute.accept (codeattribute.java:101)
[2013-11-28 13:20:10-sjh_android] at proguard.classfile.ProgramMethod.attributesAccept (programmethod.java:79)
[2013-11-28 13:20:10-sjh_android] at

Proguard.classfile.attribute.visitor.AllAttributeVisitor.visitProgramMember (allattributevisitor.java:95)
[2013-11-28 13:20:10-sjh_android] at Proguard.classfile.util.SimplifiedVisitor.visitProgramMethod

(simplifiedvisitor.java:91)
[2013-11-28 13:20:10-sjh_android] at proguard.classfile.ProgramMethod.accept (programmethod.java:71)
[2013-11-28 13:20:10-sjh_android] at proguard.classfile.ProgramClass.methodsAccept (programclass.java:504)
[2013-11-28 13:20:10-sjh_android] at Proguard.classfile.visitor.AllMethodVisitor.visitProgramClass

(allmethodvisitor.java:47)
[2013-11-28 13:20:10-sjh_android] at proguard.classfile.ProgramClass.accept (programclass.java:346)
[2013-11-28 13:20:10-sjh_android] at proguard.classfile.ClassPool.classesAccept (classpool.java:116)
[2013-11-28 13:20:10-sjh_android] at Proguard.optimize.Optimizer.execute (optimizer.java:500)
[2013-11-28 13:20:10-sjh_android] at Proguard. Proguard.optimize (proguard.java:306)
[2013-11-28 13:20:10-sjh_android] at Proguard. Proguard.execute (proguard.java:115)
[2013-11-28 13:20:10-sjh_android] at Proguard. Proguard.main (proguard.java:492)

The above error is caused by a feature jar package that uses Aurora push in the project, and there is a problem with packaging.
The following is a solution to the bill:
How do I confuse ignoring Jpush-sdk-release.jar in code?
1, please download the latest Proguard.jar,
and replace your Android SDK "Tools\proguard\lib\proguard.jar"
2. Add code to your proguard.cfg:
-dontwarn cn.jpush.**
-keep class Cn.jpush. * { ; }
3, please use sdk1.3.x and later version

Follow the above procedure to solve the problem.

The first step to download Proguard.jar, below I give my the jar package, can solve the problem: Proguard.jar
After downloading to the Android SDK "Tools\proguard\lib\proguard.jar" directory to replace the same name file.

The second part is code obfuscation, add the above two lines of code in the Proguard.cfg file below the root directory of the project file. If the project root directory does not have this proguard.cfg file, then create a new file with the same name.

Follow the above procedure to solve the problem perfectly. Record down, may be useful later, if help you solve the problem, remember to give a praise AH!!! ^_^ "Handshake"

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Solving the problem of confusing errors-the solution to the problem of packaging the signature

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.