参考文章:http://blog.csdn.net/qingyang8513/article/details/52544122
打包Android报错CommandInvokationFailure: Unable to convert classes into dex format.
PARSE ERROR:
unsupported class file version 52.0
...while parsing com/hehe/game/AppActivity.class
1 error; aborting
上面的错误说明是编辑器版本不兼容
untiy版本:5.6.0f3
将编译器的版本改成1.7就可以了
完整错误:
CommandInvokationFailure: Unable to convert classes into dex format.
C:\Program Files\Java\jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/AndroidSDK/AndroidSDK\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
PARSE ERROR:
unsupported class file version 52.0
...while parsing com/hehe/game/AppActivity.class
1 error; aborting
]
stdout[
processing archive bin\classes.jar...
processing bitter/jnibridge/JNIBridge.class...
processing bitter/jnibridge/JNIBridge$a.class...
processing com/unity3d/player/NativeLoader.class...
processing com/unity3d/player/ReflectionHelper.class...
processing com/unity3d/player/ReflectionHelper$1.class...
processing com/unity3d/player/ReflectionHelper$a.class...
processing com/unity3d/player/UnityPlayer.class...
processing com/unity3d/player/UnityPlayer$1.class...
processing com/unity3d/player/UnityPlayer$10.class...
processing com/unity3d/player/UnityPlayer$1$1.class...
processing com/unity3d/player/UnityPlayer$11.class...
processing com/unity3d/player/UnityPlayer$12.class...
processing com/unity3d/player/UnityPlayer$12$1.class...
processing com/unity3d/player/UnityPlayer$13.class...
processing com/unity3d/player/UnityPlayer$14.class...
processing com/unity3d/player/UnityPlayer$15.class...
processing com/unity3d/player/UnityPlayer$16.class...
processing com/unity3d/player/UnityPlayer$17.class...
processing com/unity3d/player/UnityPlayer$18.class...
processing com/unity3d/player/UnityPlayer$19.class...
processing com/unity3d/player/UnityPlayer$2.class...
processing com/unity3d/player/UnityPlayer$20.class...
processing com/unity3d/player/UnityPlayer$21.class...
processing com/unity3d/player/UnityPlayer$3.class...
processing com/unity3d/player/UnityPlayer$4.class...
processing com/unity3d/player/UnityPlayer$5.class...
processing com/unity3d/player/UnityPlayer$6.class...
processing com/unity3d/player/UnityPlayer$7.class...
processing com/unity3d/player/UnityPlayer$8.class...
processing com/unity3d/player/UnityPlayer$9.class...
processing com/unity3d/player/UnityPlayer$a.class...
processing com/unity3d/player/UnityPlayer$b.class...
processing com/unity3d/player/UnityPlayer$c.class...
processing com/unity3d/player/UnityPlayer$c$1.class...
processing com/unity3d/player/UnityPlayer$d.class...
processing com/unity3d/player/UnityPlayerActivity.class...
processing com/unity3d/player/UnityPlayerNativeActivity.class...
processing com/unity3d/player/UnityPlayerProxyActivity.class...
processing com/unity3d/player/UnityWebRequest.class...
processing com/unity3d/player/WWW.class...
processing com/unity3d/player/a.class...
processing com/unity3d/player/a$a.class...
processing com/unity3d/player/b.class...
processing com/unity3d/player/b$1.class...
processing com/unity3d/player/b$2.class...
processing com/unity3d/player/b$3.class...
processing com/unity3d/player/b$4.class...
processing com/unity3d/player/c.class...
processing com/unity3d/player/d.class...
processing com/unity3d/player/e.class...
processing com/unity3d/player/f.class...
processing com/unity3d/player/f$1.class...
processing com/unity3d/player/g.class...
processing com/unity3d/player/h.class...
processing com/unity3d/player/h$1.class...
processing com/unity3d/player/h$2.class...
processing com/unity3d/player/h$3.class...
processing com/unity3d/player/i.class...
processing com/unity3d/player/i$1.class...
processing com/unity3d/player/i$a.class...
processing com/unity3d/player/j.class...
processing com/unity3d/player/k.class...
processing com/unity3d/player/l.class...
processing com/unity3d/player/l$a.class...
processing com/unity3d/player/m.class...
processing com/unity3d/player/m$a.class...
processing com/unity3d/player/m$b.class...
processing org/fmod/FMODAudioDevice.class...
processing org/fmod/a.class...
processing archive plugins\.\client.jar...
ignored resource META-INF/MANIFEST.MF
ignored resource com/
ignored resource com/hehe/
ignored resource com/hehe/game/
processing com/hehe/game/AppActivity.class...
]
exit code: 1
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.HostView:OnGUI()