- Home /
Error building Player: Win32Exception - with plugin?
I installed this plugin to use Google Play Services with unity, and now I'm getting this error:
Error building Player: Win32Exception: ApplicationName='C:\Program Files\Java\jre8\bin\javac.exe'
My JAVA_HOME variable is set to the jre. If I set it to the jdk, I get an "unable to convert classes to dex format" error instead:
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details. C:\Program Files\Java\jdk1.8.0_05\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/adt-bundle-windows-x86_64-20131030/adt-bundle-windows-x86_64-20131030/sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -
If I remove the plugin, the error goes away. Anyone who uses this plugin know what the problem is?
Plugin: https://github.com/playgameservices/play-games-plugin-for-unity/tree/master/current-build
Ah, I also have an Admob plugin, and I think they're interfering with each other. I switched JAVA_HO$$anonymous$$E back to the jdk, and unstalled the admob plugin (just had the GPS plugin), and it worked...
Answer by liortal · Jul 02, 2014 at 09:39 PM
When encountering DEX errors, Unity will display the entire error message to the console. It can be helpful to see the entire error.
Usually from what i've seen, these are caused by attempting to include compiled classes multiple times in the build process.
For example, in case you're including the Google Play Services library (jar) directly yourself, and the plugin you use also has its own copy for it.
Regarding the first error (when using JRE) - not sure whether Java 8 is supported or if it's because you are using the x64 version of it (also could be a totally different reason...)
Thank you for your response.
So, using the JAVA_HO$$anonymous$$E set to the jdk, I was able to build with the Admob plugin, alone, with no errors. I was also able to build with just the GPS plugin. When combining the two I got that dex format error...
I searched my Android SD$$anonymous$$ $$anonymous$$anger files and found that GPS Library.jar file, as well as one included in my Unity Project within my plugins folder! So I deleted the one in my project and was able to build. But, Google Play Services no longer worked on my app. So I tried deleting the one from my SD$$anonymous$$ files, and just got the dex format error again...?
This occurs during Unity build right? please attach the full console output to your question. Also, it would assist if you briefly described the structure of your project (e.g: which libraries are used and where they are placed).
Yes, I get the error on build.
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/google/ads/AdRequest$Gender;
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.$$anonymous$$ain.processClass($$anonymous$$ain.java:685)
at com.android.dx.command.dexer.$$anonymous$$ain.processFileBytes($$anonymous$$ain.java:634)
at com.android.dx.command.dexer.$$anonymous$$ain.access$600($$anonymous$$ain.java:78)
at com.android.dx.command.dexer.$$anonymous$$ain$1.processFileBytes($$anonymous$$ain.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.$$anonymous$$ain.processOne($$anonymous$$ain.java:596)
at com.android.dx.command.dexer.$$anonymous$$ain.processAllFiles($$anonymous$$ain.java:498)
at com.android.dx.command.dexer.$$anonymous$$ain.run$$anonymous$$onoDex($$anonymous$$ain.java:264)
at com.android.dx.command.dexer.$$anonymous$$ain.run($$anonymous$$ain.java:230)
at com.android.dx.command.dexer.$$anonymous$$ain.main($$anonymous$$ain.java:199)
at com.android.dx.command.$$anonymous$$ain.main($$anonymous$$ain.java:103)
at sun.reflect.Native$$anonymous$$ethodAccessorImpl.invoke0(Native $$anonymous$$ethod)
at sun.reflect.Native$$anonymous$$ethodAccessorImpl.invoke(Native$$anonymous$$ethodAccessorImpl.java:62)
at sun.reflect.Delegating$$anonymous$$ethodAccessorImpl.invoke(Delegating$$anonymous$$ethodAccessorImpl.java:43)
at java.lang.reflect.$$anonymous$$ethod.invoke($$anonymous$$ethod.java:483)
at SD$$anonymous$$$$anonymous$$ain.main(SD$$anonymous$$$$anonymous$$ain.java:129)
1 error; aborting
Project Structure: >Assets >Ad$$anonymous$$obPlugin >Scripts >Editor >GooglePlayGames >BasicApi >$$anonymous$$ultiplayer >RealTime$$anonymous$$ultiplayer >ISocialPlatform >OurUtils >Platforms >Android >IOS >RealTime$$anonymous$$ultiplayer >Plugins >Android >admob-plugin.jar >GoogleAd$$anonymous$$obAdsSdk-6.4.1 >BaseGameUtils >libs >base-game-utils.jar >res >google-play-services_lib >libs >google-play-services.jar >google-play-services.jar.properties >res >source >$$anonymous$$ainLibProj >libs >play-games-plugin-support.jar >IOS
Updated. Sry, I missed the Admob plugin.
Is that all? you mention the Ad$$anonymous$$ob plugin, where is that under this hierarchy?
the class it complains about seems to originate from Ad$$anonymous$$ob (http://stuff.mit.edu:8001/afs/sipb/project/android/OldFiles/sdk/android-sdk-linux/extras/google/admob_ads_sdk/docs/com/google/ads/AdRequest.Gender.html)
Looks like you are including the Ad$$anonymous$$ob library twice somehow into the final AP$$anonymous$$ output...
Your answer
Follow this Question
Related Questions
Problem in android plugin creation.? 0 Answers
Please help!!!!!! Win32 Exception 1 Answer
Soomla Error for android 1 Answer