Solve the problem of confusion after Android introduced Unity-classes.jar

Source: Internet
Author: User

This procedure introduced the Unity3d program, then naturally uses the jar package Unity-class.jar this jar package. When confused, the following issues occur:

The first question first:

Java.io.IOException:Can ' t read [Unity-classes.jar] (Can ' t process class [Com/unity3d/player/unityplayer.class] ( Unknown verification Type [191] in stack map frame)

On this issue, the network says there are a lot of possibilities, if my solution does not solve your problem, then you can refer to the following connection:

Http://www.eoeandroid.com/thread-536303-1-1.html

http://blog.csdn.net/cupidove/article/details/8490719

http://blog.csdn.net/vrix/article/details/7100841

http://blog.csdn.net/vrix/article/details/7100944

For my question, it has nothing to do with the above, and it has nothing to do with confusing the script.

Provide me with the following reference points for the question:

https://sourceforge.net/p/proguard/bugs/420/

http://glblong.blog.51cto.com/3058613/1435941

http://glblong.blog.51cto.com/3058613/1536516

Http://stackoverflow.com/questions/23441152/proguard-with-unity3d-return-error-code-1


Therefore, according to the above reference to the confusion of the script to change, the basic can be determined to be proguard the problem of the confusion.

Never cared about this before, open the Tools folder of the SDK to see there is a Proguard folder, this is the time we confused, used to the obfuscation.

Like our basic script.

Proguard-android.txt

It is in the root directory of this folder.

Then query a bit, only to know that Java is using an open source of the obfuscation, Proguard, the official website address reference article at the end. Https://sourceforge.net/p/proguard/bugs/420/This website is devoted to this kind of obfuscation, there are officials to answer, we have a problem is best to refer to the official, or to this forum to ask questions.


The workaround is to:

find Proguard source in proguard\src\proguard\classfile\classconstants.java class, then modify the value of attr_stackmaptable to change the original stackmaptable to dummy.

1      public static final STRING ATTR_STACKMAPTABLE =  " dummy "//"StackMapTable";


Then re-proguard the ant package and use the new Proguard to confuse it without the problem above.


But in the SDK Tools directory, is not see the source of Proguard, then can not be modified and then re-build.

The method of course is everyone to the official website to download (the official website reference article at the end).

Currently the latest is 5.1, then download Proguard5.0.zip, decompression will be.

This time, it should be noted that the Proguard folder after decompression is missing a few files.

Ant folder

Proguard-android.txt

Proguard-android-optimize.txt

Proguard-project.txt

No way, these files will have to manually copy from the original SDK to go in. Otherwise, the confusion will be error, because the Proguard-android.txt file cannot be found.

After that, you can refer to the following connection for Proguard re-packaging.

http://glblong.blog.51cto.com/3058613/1536516

Ant, refer to the official website at the end of the article.

You can then overwrite the Proguard folder containing the repackaged Proguard.jar in the Tools folder of the previous SDK.

It's not over yet, and it's important below! ~


At first, I did not repackage Proguard.jar but replaced the SDK tools directly with the new version of Proguard (because I thought it might not be the issue)

For example, now the latest 5.1.

Then, in the process of confusion, the following problems occur:

[2014-12-08 16:27:52-youqu] Proguard returned with error code 1. See console
[2014-12-08 16:27:52-youqu] java.io.IOException:The same input jar [D:\adt-bundle-windows-x86_64-20140702\ Test-workspace\youqu\libs\sharesdk-qq-2.4.2.jar] is specified twice.
[2014-12-08 16:27:52-youqu] at Proguard. Configurationchecker.checkconflicts (configurationchecker.java:216)
[2014-12-08 16:27:52-youqu] at Proguard. Configurationchecker.check (configurationchecker.java:83)
[2014-12-08 16:27:52-youqu] at Proguard. Proguard.execute (proguard.java:72)
[2014-12-08 16:27:52-youqu] at Proguard. Proguard.main (proguard.java:507)

For this problem, really is not very understanding, harm I put jar package various Delete, re-import! ~

Refer to the following article:

Http://www.cnblogs.com/huanciyuan/p/4065335.html

It may be that the Proguard and Eclipse versions are incompatible.

So I had to replace the old Proguard and test the results as follows:

For 5.0, 5.1 This problem occurs, but under 4.11, including 4.11 will not appear. So I changed it to version 4.11 without a version.

After a direct substitution, it returns to the above question.

So, there is no way to avoid the trouble steps above.


In addition, there is a foreigner also appeared, Jar is because of the problem of damage, so can not read, so, if necessary, we also test your jar is damaged.

The test method is as follows:

D:\>javap-c-private-verbose-classpath D://adt-bun
Dle-windows-x86_64-20140702/test-workspace/youqu/libs/unity-classes.jar Com.unit
Y3d.player.UnityPlayer

This people should be able to understand, is the use of JAVAP anti-compilation of this jar package, if it can run correctly, it means that your jar package is not a problem, if not, ah, you can solve it in concrete.


Provide a proguard that has been repackaged: http://download.csdn.net/detail/jiguangcanhen/8237021


Resource address:

Proguard Obfuscation URL: http://proguard.sourceforge.net/

Apache Ant's Website: http://ant.apache.org/index.html


Solve the problem of confusion after Android introduced Unity-classes.jar

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.