Unity 5 Android Build Failure - No Plugins
Hello, I have run into a similar error several times in the past with different android plugins and I know how to fix that ... but now I have no plugins because I believed that deleting them should solve the issue but it didn't.. Here is the error:
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/oyinmiebiperealbert/Documents/android-sdk-macosx/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
stderr[ Exception in thread "main" java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:800) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:278) at SDKMain.main(SDKMain.java:127) ] stdout[
]
I have no idea on what to do since I have no plugin in the project. Please, I will appreciate some help
Answer by pbrandt1 · Jul 09, 2016 at 04:03 PM
After you install JDK 1.8 you may need to update your Unity preferences to point to it.
in File > Preferences > External Tools, click the "Browse" button to the right of the JDK configuration box and choose the right directory. On my mac, it was /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home
.
Answer by Montoli · May 18, 2016 at 11:15 PM
Hit this problem, and it went away when I updated my version of the JDK to from 1.7 -> 1.8.
Hope that helps!