- Home /
Unable to convert classes into dex format
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/prakash/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/Unity4.6.2p2.app/Contents/BuildTargetTools/AndroidPlayer/sdktools.jar" -
stderr[
UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.IllegalArgumentException: already added: Lcom/google/ads/AdSize; at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122) at com.android.dx.dex.file.DexFile.add(DexFile.java:161) at com.android.dx.command.dexer.Main.processClass(Main.java:732) at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) at com.android.dx.command.dexer.Main.access$300(Main.java:83) at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602) at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:229) at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:158) at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) at com.android.dx.command.dexer.Main.processOne(Main.java:632) at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280) at com.android.dx.command.dexer.Main.run(Main.java:246) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at SDKMain.main(SDKMain.java:130) 1 error; aborting ] stdout[ processing archive bin/classes.jar... processing com/unity3d/player/a$1.class... processing com/unity3d/player/a$2.class... processing com/unity3d/player/a$a.class... processing com/unity3d/player/a.class... processing com/unity3d/player/b.class... processing com/unity3d/player/c$1.class... processing com/unity3d/player/c$2.class... processing com/unity3d/player/c.class... processing com/unity3d/player/d.class... processing com/unity3d/player/e$1.class... processing com/unity3d/player/e$2.class...
---------goes on and on.....
We are using unity4.6.2p2, google admob from this http://forum.unity3d.com/threads/free-admob-plugin-simple-prefab.167731/page-2", targeting for android.
Thanks in advance!
were you using any other plug in? or this happened to you just after adding Ad$$anonymous$$ob?
We were using multiple plugins for ads, such as unity ads for video ads, admob for banner ad, game promotion network.
But issue was with duplicate copies of ads folder inside the file "google-play-services.jar". And to be honest we were not sure, That ad folder was related to admob or unityads. So we removed the ads folder, which was there outside the google folder, left the ads folder which is already available inside google folder structure.
Answer by achillesdotexe · May 22, 2015 at 12:08 PM
I figured out how to fix this. We need to remove "ads" references from the jar file[used JD_GUI tool] in this path "plugins/android/google-play-services_lib/lib/google-play-services.jar". Because its was conflicting with admob. Everything is working fine now.
thanks, I had to remove external plugins but your post has helped me to accelerate the debug process.
Answer by avi9111 · Feb 27, 2016 at 03:59 PM
I had the same situation, thanks , though I did not have to use js_gui, I encode jar with the command "java -cvf xxxx.jar cn\" instead of "xxx.jar ", remember not to use to package multiple R in jar, then i work find in u3d android package
Your answer
Follow this Question
Related Questions
AdMob + Unity + Emulator = No Ad? (Is it supposed to be like this?) 0 Answers
How do Smart Banners scale? 0 Answers
Admob banner ads not showing 0 Answers
Admob not working 1 Answer
too many languages in apk 0 Answers