Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proguard with Unity3d return error code 1

I am using the proguard 4.11 with the Unity 3d

In my project , I have include the unity-classes.jar in my libs folder

When I generate the apk , it gives the following exception

    [2014-05-03 14:33:41 - FBUnityPlayerActivity] Proguard returned with error code 1. See console
[2014-05-03 14:33:41 - FBUnityPlayerActivity] java.io.IOException: Can't read [C:\Users\TAT\Desktop\quick\FBUnityPlayerActivity\libs\unity-classes.jar] (Can't process class [com/unity3d/player/UnityPlayer.class] (Unknown verification type [195] in stack map frame))
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.InputReader.readInput(InputReader.java:232)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.InputReader.readInput(InputReader.java:202)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.InputReader.readInput(InputReader.java:180)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.InputReader.execute(InputReader.java:78)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.ProGuard.readInput(ProGuard.java:196)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.ProGuard.execute(ProGuard.java:78)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.ProGuard.main(ProGuard.java:483)
[2014-05-03 14:33:41 - FBUnityPlayerActivity] Caused by: java.io.IOException: Can't process class [com/unity3d/player/UnityPlayer.class] (Unknown verification type [195] in stack map frame)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.io.ClassReader.read(ClassReader.java:112)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.io.JarReader.read(JarReader.java:65)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.InputReader.readInput(InputReader.java:228)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   ... 6 more
[2014-05-03 14:33:41 - FBUnityPlayerActivity] Caused by: java.lang.RuntimeException: Unknown verification type [195] in stack map frame
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.io.ProgramClassReader.createVerificationType(ProgramClassReader.java:890)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.io.ProgramClassReader.visitFullFrame(ProgramClassReader.java:659)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.attribute.preverification.FullFrame.accept(FullFrame.java:114)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.io.ProgramClassReader.visitStackMapTableAttribute(ProgramClassReader.java:452)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.attribute.preverification.StackMapTableAttribute.accept(StackMapTableAttribute.java:71)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.io.ProgramClassReader.visitCodeAttribute(ProgramClassReader.java:422)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.attribute.CodeAttribute.accept(CodeAttribute.java:101)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.io.ProgramClassReader.visitProgramMethod(ProgramClassReader.java:200)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:142)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   at proguard.io.ClassReader.read(ClassReader.java:91)
[2014-05-03 14:33:41 - FBUnityPlayerActivity]   ... 12 more

I have already tried using

-libraryjars /libs/unity-classes.jar
-keep class com.unity3d.** { *; }
-dontwarn com.unity3d.**

in the proguard-project.txt , still the same, how to fix it? Thanks for helping

Tried even

-keep class com.** { *; }

still the same

like image 374
user782104 Avatar asked May 03 '14 06:05

user782104


2 Answers

See an earlier question on Proguard errors with unity-classes.jar.

This is an issue with the classes in the Unity library: some of the preverification metadata are corrupt. You should check if there is a more recent version. Otherwise, you could modify ProGuard to accept the corrupt classes, as discussed on its issue tracker.

Note that you should not add -libraryjars or -injars to your configuration. The Android build process (Ant, Eclipse, Gradle) already specifies those options for you.

like image 105
Eric Lafortune Avatar answered Oct 04 '22 15:10

Eric Lafortune


Try add this in your proguard-project.txt:

-keep class com.unity3d.** { *; }
-keep class org.fmod.** { *; }
like image 33
wbelarmino Avatar answered Oct 04 '22 15:10

wbelarmino