Search Unity

Unable to convert classes to dex format - Android issue

Discussion in 'Android' started by ixikos, Aug 22, 2013.

  1. ixikos

    ixikos

    Joined:
    Jun 21, 2013
    Posts:
    19
    I've been wracking my brain on this issue, never had it before. Tried so many different things. I am on a mac, attempting to deploy an Android version of our app. I keep getting this error:

    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home/bin/java -Xmx1024M -Dcom.android.sdkmanager.toolsdir="/Users/ixikos/adt/adt-bundle-mac-x86_64-20130729/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/Unity.app/Contents/BuildTargetTools/AndroidPlayer/sdktools.jar" -

    I've tried installing different versions of the android sdk (18, 17, 16, 15, ... 6)
    Deleting and installing different versions of jdk.

    Any thoughts or experiences would be welcome.
     
    guetta18, vexe and Deleted User like this.
  2. KristoE

    KristoE

    Joined:
    Oct 13, 2012
    Posts:
    88
    I have the same issue. Any help would be more than welcome.
    Or if you solved it yourself please post how.
     
  3. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    We are having this issue as well, and cannot make Android builds anymore because of it. Any help would be great.
     
  4. DreamEnder

    DreamEnder

    Joined:
    Apr 12, 2011
    Posts:
    190
    Just started using a hackintosh and now I can't build any more Android builds due to the same issue. Can anyone shed some light on this?
     
  5. DreamEnder

    DreamEnder

    Joined:
    Apr 12, 2011
    Posts:
    190
    There is extra info in the console:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:128)
    at java.util.zip.ZipFile.<init>(ZipFile.java:145)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:206)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:422)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
    at com.android.dx.command.dexer.Main.run(Main.java:209)
    at com.android.dx.command.dexer.Main.main(Main.java:174)
    at com.android.dx.command.Main.main(Main.java:91)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at SDKMain.main(SDKMain.java:124)
    1 error; aborting
     
  6. Jon.W.Young

    Jon.W.Young

    Joined:
    Dec 11, 2012
    Posts:
    2
    I'm getting the same error and the exact same console output as DreamEnder. I updated to the latest Unity this morning so I suspect that's related. Has anyone found a solution?
     
  7. KristoE

    KristoE

    Joined:
    Oct 13, 2012
    Posts:
    88
    My issue was actually related to having duplicate files. Well not really duplicates, but I had 2 adMob sdk packages (different versions), that were getting into conflict. After deleting the older one, everything was fixed. Are you using any 3rd party SDK's or something similar, if so, try removing them if possible and see if the issue persists. Try to find out which part of the code is causing this to happen. You could ultimately try to compile an empty project just for testing.
     
  8. anshul-bhardwaj

    anshul-bhardwaj

    Joined:
    Feb 28, 2012
    Posts:
    34
    we are having the same issue, Anyone able to solve this, please help.
     
  9. Maccyfin

    Maccyfin

    Joined:
    Aug 19, 2012
    Posts:
    53
    hey all. I come across this same error sometimes. Its when i import a new package and then two of the same jar files in the project. For example, I had 2 versions of the heyzap.jar file. I just deleted the old version from the project and it was solved. It also happened with the admob sdk (contains the googleAds jar), and the billing sdk for google play. Sometimes the jar file versions have different names so watch out for that. I usually take a screenshot of the package files before I do the import so I can go back and look it over. I also always always always do a back up of the project before importing 3rd party plugins - saves a lot of headaches.

    hope this helps
    Martin
     
    KaranStudio, varumora, rago and 4 others like this.
  10. TheHats

    TheHats

    Joined:
    Jul 4, 2013
    Posts:
    2
    Getting the same error after updating to 4.3 and trying to use the OUYA plugin

    I'm not sure what the posters above are talking about in regards to deleting duplicate files. I went into my android SDK and uninstalled all but one version (16)

    Here is my error message:

    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    C:\Program Files\Java\jdk1.7.0_03\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk\tools" -Dfile.encoding=UTF8 -jar "D:/Unity_4_3/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

    stderr[

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/Hatsproductions/Prototype/Drink/R$attr;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    at com.android.dx.command.dexer.Main.processClass(Main.java:490)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
    at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    at com.android.dx.command.dexer.Main.processOne(Main.java:422)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
    at com.android.dx.command.dexer.Main.run(Main.java:209)
    at com.android.dx.command.dexer.Main.main(Main.java:174)
    at com.android.dx.command.Main.main(Main.java:91)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at SDKMain.main(SDKMain.java:129)
    1 error; aborting
    ]
     
    Last edited: Nov 15, 2013
  11. jmansa

    jmansa

    Joined:
    Apr 13, 2012
    Posts:
    53
    Same problem here... Did you get an solution?
     
  12. PeterBr

    PeterBr

    Joined:
    Nov 20, 2013
    Posts:
    1
    I deleted all the hidden Mac files called "._something" and it worked again.
     
    angioline likes this.
  13. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    143
    Happened to me when I upgraded to 4.3. I got rid of it by doing a Reimport All.
     
  14. MildaGenius2

    MildaGenius2

    Joined:
    May 6, 2013
    Posts:
    17
    I have two jars with the same classes in Plugins/Android. After removing one of them build is running again.
     
    Chilles, Ka3u6y6a and holczhauser like this.
  15. rsb_jeremy

    rsb_jeremy

    Joined:
    Jan 8, 2014
    Posts:
    5
    When I ran into this recently, it seems to be caused by using a JAR which references classes.jar for android. It seems that I must reference the AndroidDevelopmentPlayer version when building my JAR if I want to build a development player the AndroidPlayer version if I'm not. I guess this kinda makes sense, but it also seems a little weird, since it's just a reference.
     
  16. Skyboard_Studios

    Skyboard_Studios

    Joined:
    Jul 20, 2013
    Posts:
    51
    I found the solution was also in the Plugins\Android folder. With inspection I found the issue and was able to build to device. whooo hoo.
     
  17. sandiprudani

    sandiprudani

    Joined:
    Aug 16, 2012
    Posts:
    1
    Hello SkyboardSoftware ,

    Can you please tell me how you solve this problem ?
     
  18. BisongT

    BisongT

    Joined:
    Nov 27, 2013
    Posts:
    9
    My problem was I had two In-app billing plugins. I got rid of one entirely and my problem was solved!
     
    Addyarb likes this.
  19. StevenSauer

    StevenSauer

    Joined:
    Mar 25, 2013
    Posts:
    19
    @sandiprudani others who haven't solved this

    I had a very similar problem as this and my issue was that their were duplicate files interfering with each other in the Plugins/Android folder. Unity has the ability to check file depth in this folder, meaning that if you have a Plugins/Android/lib folder and a Plugins/Android/SomePlugin/lib folder, Unity will merge them during the build process. I had recently updated a Facebook plugin and it had created the folder: Plugins/Android/FacebookPlugin. In this folder, there was a /lib folder and a /res folder. Because the older version of my Facebook plugin simply added these files to the normal Plugins/Android/res and Plugins/Android/lib I now had two lib folders and two res folders, the newest of which just and extra folder level deep. Unity still recognized both folders and merged them, but two files were identical, so it failed on the conflict. Simply deleting my old duplicates fixed my issue.

    Hope this helped!
     
    kay_2706 and Knarhoi like this.
  20. pain_gwar

    pain_gwar

    Joined:
    Apr 14, 2013
    Posts:
    22
    I had the same problem when i had imported the GooglePlayServices plugin in a project where were already present a third party plugin for AdMob (in my case). I had to delete the third party plugin to make the build, but as StevenSauer said it must be an issue relative to duplicate files.
    Here the link for a workaround for the GooglePlayServices, i know that probably you are not using this one but maybe you can use the same "technic"
    https://github.com/playgameservices/play-games-plugin-for-unity/issues/6

    Hope it could help
     
    drktoninato likes this.
  21. copypasteearth

    copypasteearth

    Joined:
    Jun 7, 2013
    Posts:
    11
    im having this problem with prime31 google play game services here is the output, does anyone have a solution to this problem, it a new project with just 1 prime31 package with the realtime multiplayer demo scene, and it wont build

    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    C:\Program Files (x86)\Java\jdk1.7.0_51\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Users/John P. Rowan III/android-sdks\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

    stderr[

    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dx.cf.iface.ParseException: bad class file magic (00051607) or version (0000.0002)
    at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
    at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
    at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
    at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
    at com.android.dx.command.dexer.Main.processClass(Main.java:665)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
    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:596)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at SDKMain.main(SDKMain.java:129)
    ...while parsing __MACOSX/com/google/android/gms/ads/._a.class

    1 error; aborting
    ]
     
  22. yurilin1

    yurilin1

    Joined:
    May 22, 2013
    Posts:
    89
    That's the answer.
    For example,like install android native plugin aftter admob plugin.
    That's not a conflict,very lucky.
     
  23. haneul

    haneul

    Joined:
    Jan 16, 2014
    Posts:
    2
    I have same problem after importing android native plugin.

    stderr[

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/android/vending/billing/IInAppBillingService$Stub$Proxy;
    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:685)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
    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:596)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at SDKMain.main(SDKMain.java:129)

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs;
    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:685)
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)
    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:596)
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)
    at com.android.dx.command.dexer.Main.run(Main.java:230)
    at com.android.dx.command.dexer.Main.main(Main.java:199)
    at com.android.dx.command.Main.main(Main.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at SDKMain.main(SDKMain.java:129)
    2 errors; aborting
    ]

    is there anyone to solve this problem? please help me...
     
  24. haneul

    haneul

    Joined:
    Jan 16, 2014
    Posts:
    2
    I solve this problem.
    first, I remove all files in plugins folder,

    and I attached plugin file one by one that I need.

    then, I success to build my app :)

    So if you have this problem, that should be coupled plugin module,

    however it is too hard to find coupled module,

    so, remove all files in plugin folder, and add what you need.

    ps. back up plugin file before you remove :)
     
  25. sama-van

    sama-van

    Joined:
    Jun 2, 2009
    Posts:
    1,525
    Same here.
    Plugin kill and imported one more time all packages :(
     
    SirParzival likes this.
  26. MarceloBarce

    MarceloBarce

    Joined:
    Jan 6, 2013
    Posts:
    35
    I got this error by updating older plugins in my project.

    But I SOLVED it by removing all my plugins and importing them again.
     
    Ylex likes this.
  27. Vladimir_BL

    Vladimir_BL

    Joined:
    Nov 13, 2013
    Posts:
    1
    I think that I have universal way:
    It shows the problem: "java.lang.IllegalArgumentException: already added: ......" and name of the class (for example: IInAppBillingService$Stub$Proxy)
    Using any utility (like grep) or your FileManager' feature to search inside of files just search this class (IInAppBillingService) in all files and remove all extra files (.jar) that contain it. "There can be only one" :)
     
    zoran404 likes this.
  28. Evil-Dog

    Evil-Dog

    Joined:
    Oct 4, 2011
    Posts:
    134
    For me, I had the file "android-support-v4" twice, I deleted one and it's working fine now.
     
  29. Lance-Huang

    Lance-Huang

    Joined:
    Apr 7, 2013
    Posts:
    2
    Delete unrelated file from Android/libs directory, only keep Android - support - v4 files

    My problem is resolved

    You can try.
     
  30. icywind

    icywind

    Joined:
    Feb 10, 2014
    Posts:
    1
    Another possibility is an update from a 3rd party SDK. There is jar upgrade but not replaced. E.g., ver1.1.1.jar and ver1.1.2.jar both present in the project. You may think you already removed the old from from your version control system. But you should also check: unity/Temp/StagingArea/plugins
    for any residual files there.
     
  31. rob_3d

    rob_3d

    Joined:
    Jan 20, 2014
    Posts:
    2
    Thank you very much, I saved a lot of time.
     
  32. Phuzz

    Phuzz

    Joined:
    Mar 31, 2014
    Posts:
    47
    I had this problem, I didn't and it appeared only once, I tried to build again and it worked fine without changing anything, I am sure it is a file duplication issue tho.
     
    Zepam likes this.
  33. smallbit

    smallbit

    Joined:
    Oct 3, 2013
    Posts:
    54
    Just had the same problem, and as mentions above with new heyzap plugin. To solve it I just removed old jar in Plugins/Android folder.
     
  34. psyydack

    psyydack

    Joined:
    Aug 30, 2013
    Posts:
    93
    I had installed FB Unity, so I decided to install Prime31. Well, the error show up.
    After many hours, the file with error is bolt.jar. I removed and removed duplicated android-support and can build again.
     
  35. tolosaoldfan

    tolosaoldfan

    Joined:
    Sep 14, 2012
    Posts:
    65
    Hi,
    I deleted the android-support-v4 lib and it solved the issue. Thanks !
     
  36. CYS

    CYS

    Joined:
    Aug 25, 2013
    Posts:
    11
    I think the easiest way to solve this is to do a search for all "*.jar" files in your project folder. Then simply delete the duplicates. Solved it for me.
     
  37. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    You are right! However, sometimes there are 2 jar files with different names, but inside those jars there are classes with the same names. This can cause the problem as well.
     
  38. vzasadnyy

    vzasadnyy

    Joined:
    Jun 10, 2013
    Posts:
    13
    This exceptions will also pop up if you'll update to new version of *.jar library just by copying it with Finder/Explorer.
    Problem is with corresponding .meta file that don't get regenerated. To fix this: just remove old .meta file for .jar library.
     
  39. Vivek Ramasamy

    Vivek Ramasamy

    Joined:
    Dec 23, 2014
    Posts:
    1
    Hi,

    Anyone Please give solution for these

    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    C:\Program Files\Java\jdk1.7.0_71\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Users/h112636/android-sdks\tools" -Dfile.encoding=UTF8 -jar
    "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

    stderr[

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:215)
    at java.util.zip.ZipFile.<init>(ZipFile.java:145)
    at java.util.zip.ZipFile.<init>(ZipFile.java:159)
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
    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:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at SDKMain.main(SDKMain.java:130)
    1 error; aborting
     
  40. DevangPanchasara

    DevangPanchasara

    Joined:
    Jul 2, 2013
    Posts:
    3
    Hello All,
    I had same kind of problem and had OUTPUT as Following

    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    C:\Program Files\Java\jdk1.8.0_31\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="E:/Development/Android/sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

    stderr[

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: Lcom/android/vending/billing/IInAppBillingService$Stub$Proxy;
    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:483)
    at SDKMain.main(SDKMain.java:129)
    1 error; aborting

    ]

    I solved THIS PROBLEM in my case. The Problem was conflicting InAppBillingLibrary in project.
    I was trying all available In-app billing librares available
    First I imported Soomla Packages and was able to BUILD.
    Then I tried to import OPENIAB packages and when TRIED ti build this ERROR CAME.
    SO, I just REMOVED all SOOMLA PACKAGE CONTENTS keeping only OPENIAB package contents from my unity project and all is fine now.
     
  41. ayyappa

    ayyappa

    Joined:
    Jan 4, 2014
    Posts:
    27
    This happens just because of duplicate jar files. try removing the duplicates. it will work.
     
  42. Kurius

    Kurius

    Joined:
    Sep 29, 2013
    Posts:
    412
    You are right. However, sometimes there are 2 jar files with different names, but inside those jars there are classes with the same names. This can cause the problem as well.
     
    bradknox likes this.
  43. ayyappa

    ayyappa

    Joined:
    Jan 4, 2014
    Posts:
    27
    @Kurius Exactly what I went through when integrating Twitters Fabric last night . You explained straight to the exact problem. (bow)
     
  44. sdmattos

    sdmattos

    Joined:
    Jan 11, 2015
    Posts:
    7
    Can anyone explain where the .jar files would be i am experiencing the same issues but cannot find the jar files.
     
  45. shadab_badar

    shadab_badar

    Joined:
    Aug 2, 2013
    Posts:
    3
    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.


    I solved this problem by simply changing the sdk path to a new adt bundle that contains sdk (this sdk folder was actually working for one of my friend ).
     
  46. twDuke

    twDuke

    Joined:
    Nov 18, 2012
    Posts:
    3
    Had the same issue, solved by removing duplicate jar files under Plugins/Android/**
     
    id3644unity likes this.
  47. alexZhang

    alexZhang

    Joined:
    Mar 24, 2014
    Posts:
    2
    its spent me lot's of time. and i decide to give up. i try it so many times & ways just one jar file.
     
  48. knifesk

    knifesk

    Joined:
    Apr 29, 2013
    Posts:
    9
    I had this issue and it was caused by Facebook SDK... I recently updated it... and it was using a plugin called "bolts".. the new version added "bolts-android-1.1.2.jar", thus I had this library twice.. just deleted "bolts" and project is compiling again.
     
  49. GDChrist

    GDChrist

    Joined:
    Jan 25, 2015
    Posts:
    1
    I Got Mine! I just mistype the capital.
    # in the playersetting
    com/facebook/GameName(should be)
    com/Facebook/GameName(me)
     
  50. Modismos

    Modismos

    Joined:
    Jan 2, 2015
    Posts:
    1
    I had the same error "Unable to convert classes into dex format." that was introduced while implementing the Soomla Profile plugin.
    Somewhere along the way the "AndroidProfile" and "UnityAndroidProfile" were duplicated to "AndroidProfile 1" and "UnityAndroidProfile 1". Removing the dups took care of the errors.
     
unityunity