BUILD FAILED [Multiple dex files define ... BuildConfig]

mouflon

  • Posts: 28
OK, I have been trying to get my app to build on Android using Admob for some time now. I am using windows 8 and the latest 3.2 build of stencyl. I successfully ran several debug builds and displayed admob test ads as I wished to. I have made no changes that I am aware of in the project but now it no longer builds to andorid. I don't know why, I feel like it's totally random as to wether it works or not. Please help, I feel like publishing to android is like banging my head against a brick wall. I have attached logs.

2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx] UNEXPECTED TOP-LEVEL EXCEPTION:
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx] com.android.dex.DexException: Multiple dex files define Lcom/turbonuke/pixelninja/BuildConfig;
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:593)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:551)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:532)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:169)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.merge.DexMerger.merge(DexMerger.java:187)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.command.dexer.Main.run(Main.java:230)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.command.dexer.Main.main(Main.java:199)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]    at com.android.dx.command.Main.main(Main.java:103)
2014-10-06 17:31:13,068 INFO  [Thread-13] stencyl.sw.util.StreamGobbler:        [dx]
2014-10-06 17:31:13,489 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: BUILD FAILED
2014-10-06 17:31:13,489 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: C:\Users\Mr\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:885: The following error occurred while executing this line:
2014-10-06 17:31:13,489 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: C:\Users\Mr\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:887: The following error occurred while executing this line:
2014-10-06 17:31:13,489 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: C:\Users\Mr\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:899: The following error occurred while executing this line:
2014-10-06 17:31:13,489 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: C:\Users\Mr\AppData\Roaming\Stencyl\stencylworks\android-sdk\android-sdk-windows\tools\ant\build.xml:281: null returned: 2
2014-10-06 17:31:13,489 INFO  [Thread-13] stencyl.sw.util.StreamGobbler: Total time: 13 seconds
2014-10-06 17:31:13,599 ERROR [Util-CommandMonitor] stencyl.sw.io.write.resource.HXWriter: Building for Android failed. (Return code: 1)

« Last Edit: November 13, 2014, 04:39:56 am by captaincomic »

ManlyMouse

  • Posts: 144
You're not the only one running into this error, I ran into it a while back. Maybe this will help you:

http://community.stencyl.com/index.php/topic,35569.0.html
I know more about Stencyl now.

mouflon

  • Posts: 28
OK, so I managed to figure out some of the problem. I had changed the appID name. This caused the build to fail. So I changed the appID back to the original name it had. But the build still failed. The compiler was still refering to files for the new appID? So I searched for and deleted that directory, and now it builds.

SO - how do I change the appID name (which I need to do) without breaking the whole thing?

"I finally got it to compile after changing the project name completely. Kind of a strange process but it seems to be working for now."

Might try this and see if it works, export it as a new project... but it'll have to wait until I can face staring at errors again

mouflon

  • Posts: 28
Saving as.... a new project name, THEN changing AppID works. Cheers ManlyMouse.

ManlyMouse

  • Posts: 144
No problem, glad I could help!
I know more about Stencyl now.

porkwaffle

  • Posts: 10
This worked for me as well (on 3.2)  Thanks!!
Asteroid Survival - FREE


   Android
   Amazon

CanadianHobo

  • Posts: 24
Under what directory are these files? I am not sure what to delete. 

Thanks

CanadianHobo

  • Posts: 24
nvm; found them

For those that are looking for them:
C:\Users\[YOU]\Desktop\Stencyl\stencylworks\games-generated\[YOUR_GAME]