Unable to convert classes into dex format, with no duplicate .jar files

I’m trying to build on Android, and after adding the Google Play Games Services plugin, I’m getting this error:

Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. C:\Program Files\Java\jdk1.7.0_79\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir=“C:/Users/applesauce/AppData/Local/Android/sdk\tools” -Dfile.encoding=UTF8 -jar “C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar” -

stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/ads/identifier/AdvertisingIdClient$Info;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/GoogleAuthException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/GoogleAuthUtil;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/GooglePlayServicesAvailabilityException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/UserRecoverableAuthException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/UserRecoverableNotifiedException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/AccountPicker;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/ConnectionResult;

The common answer seems to be “delete the duplicate .jar files”. The problem is, I have no duplicate .jar files. I’ve checked, and they’re all unique.

Furthermore, I’ve used JD-GUI to verify that the things above that were supposedly already added (e.g. AdvertisingIdClient, GoogleAuthUtil, etc.) only appear in one .jar file each. So if they are being added multiple times, I can only find the source of one such addition.

What might cause this issue, and how might I resolve it?

Thank you.

You have some duplications for sure. You just have to look them up closely :slight_smile: contact me in private if you need help with that.

Any solution too this problem. I tried to build my game on android and I’m getting this message
Error building Player: CommandInvokationFailure: 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/Emmanuel/NVPACK/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:274)
at SDKMain.main(SDKMain.java:127)
]
stdout[

]

I think you should try to install JDK 8 and point Unity to use that.

Thanks I will try that now.