Error when building for Android after importing an asset from the store.
Hello, I just bought an asset called Cross Platform Native Plugins - Ultra Pack. It's very easy to use and well documented, however when I try to test it on my mobile device I get this error ( when Gradle is tasking "IncrementalDebugJavaCompilationSafeguard" ).
These are the details of the error:
CommandInvokationFailure: Gradle build failed.
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java -classpath "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-2.14.jar" org.gradle.launcher.GradleMain "assembleDebug"
stderr[
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lcom/twitter/sdk/android/core/BuildConfig;
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/twitter/sdk/android/core/BuildConfig;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:591)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:546)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:528)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
PS: I already contacted the developers but they didn't answer, yet. I also opened a discussion on their forum but nobody answered, yet. Thank you for your time.
Answer by MrCrumbl3d · May 24, 2017 at 07:42 AM
try to search in unity "AndroidManifest" and tell me if it got 2 androidmanifest if it has two try to move one of them to your desktop and try to build it.
Ok, I tried many solutions, but this one works! When I imported "Audience Network" plugin from Facebook, it has another $$anonymous$$anifest.xml sample file, when I deleted that folder, I can build AP$$anonymous$$ normally! Thanks @$$anonymous$$rCrumbl3d, you saved me a bunch!
This is not working for me .
I have many android manifest .below is the list GooglePlayGames/Plugins/Android/GooglePlayGames$$anonymous$$anifest.plugin
Plugins/Android/
ChartBoostSD$$anonymous$$/Plugins/Android/
Plugins/Android/Google$$anonymous$$obileAdsPlugin
Plugins/Android/google-play-services_lib
Other files :
PlayFabSD$$anonymous$$/Editor/Android$$anonymous$$anifest$$anonymous$$anager
FacebookSD$$anonymous$$/sdk/Editor/Android/DefaultAndroid$$anonymous$$anifest.xml
AudienceNetwork/Editor/Android/DefaultAndroid$$anonymous$$anifest.xml
GooglePlayGames/Editor/template-Android$$anonymous$$anifest.txt
I have delete the Androud$$anonymous$$anifest file in Audience Network as mentioned in above reply . But still its working for me
I have also two Android$$anonymous$$anifest.xml file
One is for android google play games
and
One if for Google$$anonymous$$obileAds
if I delete one of them, they said file is missing
so how i merge them