Log in or register to post comments

Unable to convert classes into dex format. See the Console for details.

July 15, 2016 - 8:21am #1

Hi,

  Couldn't able to take Android build. I'm getting error message as 'Unable to convert classes into dex format. See the Console for details.'

 

Unable to convert classes into dex format. See the Console for details.
/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/HBI-MacMini/Library/Android/sdk/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:274)
at SDKMain.main(SDKMain.java:127)
]
stdout[

]
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()

 

After searching in google. They need to check duplicate jar file. I tried in folder Vuforia.jar and VuforiaUnityPlayer.jar present two time.

One in Plugin -> Android ->  

Another one is in Temp/StagingArea/plugins

I delete one set of .jar file. After that camera is not starting. 

Unable to convert classes into dex format. See the Console for details.

August 7, 2017 - 6:59am #7

Thank you so much, the upgrade to jdk1.8 worked for me.

Unable to convert classes into dex format. See the Console for details.

June 1, 2017 - 6:39am #6

kenneth33 wrote:

Hi,

Don't delete the jar files, instead just need to update java to 1.8 or higher,  but VERY IMPORTANT: You need to change the Unity Java Path: on Edit-> Preferences -> External Tools and change to update the SDK to the new folder with 1.8> of Java.

 

for example: 

C:\Program Files (x86)\Java\jdk1.7.0_1\

to

C:\Program Files (x86)\Java\jdk1.8.0_111\

 

Now my app works on android with the camera.





This worked! Thanks

Unable to convert classes into dex format. See the Console for details.

January 6, 2017 - 10:13am #5

Hi,

Don't delete the jar files, instead just need to update java to 1.8 or higher,  but VERY IMPORTANT: You need to change the Unity Java Path: on Edit-> Preferences -> External Tools and change to update the SDK to the new folder with 1.8> of Java.

 

for example: 

C:\Program Files (x86)\Java\jdk1.7.0_1\

to

C:\Program Files (x86)\Java\jdk1.8.0_111\

 

Now my app works on android with the camera.

Unable to convert classes into dex format. See the Console for details.

July 25, 2016 - 10:54am #4

Hello,

One of our devs solved this problem in their environment by upgrading to JDK 1.8 from 1.7.

Thanks

Unable to convert classes into dex format. See the Console for details.

July 23, 2016 - 9:15pm #3

I'm having the same problem as Vassan, using Unity and Vuforia in OS X. The error goes away when you delete Vuforia.jar and VuforiaUnityPlayer.jar from /Users/Shared/Unity/<Project Name>/Assets/Plugins/Android/. But then the resultant apk only shows a black screen when run.

I tried creating a new Unity project and importing Vuforia and my target database. The error "CommandInvokationFailure: Unable to convert classes into dex format." appears as before.

The consensus within the Unity community appears to be that this error comes from having two Java classes with the same name (e.g., https://kierenpitts.com/blog/2014/10/how-to-solve-the-unable-to-convert-classes-into-dex-format-unity-error/). However, using "jar tf <filename>" for both Vuforia.jar and VuforiaUnityPlayer.jar, I did not see any duplicates.

Unable to convert classes into dex format. See the Console for details.

July 22, 2016 - 7:36pm #2

I just deleted Vuforia.jar and VuforiaUnityPlayer.jar in assets\android

and it works !!!

thanks a LOT

Log in or register to post comments