Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by omaglana · Sep 25, 2018 at 10:25 AM · errorjavaexception

DexArchiveMergerException: Unable to merge dex

I've tried implementing unity Admob but then upon implementing the game I get error describing about Dex Archive Merger

 CommandInvokationFailure: Gradle build failed. 
 C:/Program Files/Java/jdk1.8.0_161\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleDebug"
 
 stderr[
 
 FAILURE: Build failed with an exception.
 
 * What went wrong:
 Execution failed for task ':transformDexArchiveWithExternalLibsDexMergerForDebug'.
 > java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
 
 * Try:
 Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
 
 * Get more help at https://help.gradle.org
 
 BUILD FAILED in 43s
 ]
 stdout[
 :preBuild UP-TO-DATE
 :preDebugBuild
 :compileDebugAidl
 :compileDebugRenderscript
 :checkDebugManifest
 :generateDebugBuildConfig
 :prepareLintJar
 :generateDebugResValues
 :generateDebugResources
 :mergeDebugResources
 :createDebugCompatibleScreenManifests
 :processDebugManifest
 :splitsDiscoveryTaskDebug
 :processDebugResources
 :generateDebugSources
 :javaPreCompileDebug
 :compileDebugJavaWithJavac
 :compileDebugNdk NO-SOURCE
 :compileDebugSources
 :mergeDebugShaders
 :compileDebugShaders
 :generateDebugAssets
 :mergeDebugAssets
 :transformClassesWithDexBuilderForDebug
 :transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
 19 actionable tasks: 19 executed
 ]
 exit code: 1
 UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
 UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
 UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1 progress, System.String error)
 UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress)
 Rethrow as GradleInvokationException: Gradle build failed
 UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1 progress)
 UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
 UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
 UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

How do I resolve this kind of issue?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

4 Replies

· Add your reply
  • Sort: 
avatar image
9

Answer by Morgun71 · Jun 23, 2020 at 09:43 PM

Looks like if you change Minimum API Level to Android 5.0 it can help with this issue. (it has some other multidex settings). This helped me.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ThinhHB · Jun 25, 2020 at 08:53 AM 0
Share

You're my savior !!! Thanks a lot

avatar image Eloren · Oct 13, 2020 at 11:33 AM 0
Share

thanks man

avatar image tuan_dq · Jun 01, 2021 at 05:15 AM 0
Share

Thanks! is work for me!

avatar image DraxThemSklounst · Jul 29, 2021 at 11:34 PM 0
Share

THANK YOU!!!!!!!!

avatar image jadynut · Oct 13, 2021 at 08:56 AM 0
Share

This worked for me!! Thanks

avatar image
2

Answer by nextage575 · Jul 29, 2020 at 06:33 AM

Go to build player settings-->Publishing settings and set Release to dropdown Gradle experimental and hit build,worked for me.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by k3nz1e · May 07, 2019 at 02:56 AM

I was able to fix this by going through my plugin folders and finding duplicates.

Comment
Add comment · Show 4 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image seanbiganski · May 31, 2019 at 05:54 PM 0
Share

@k3nz1e What do you mean by duplicates? Since a file name can't be in the same folder more than once, what qualifies as a duplicate?

I've been stuck on this for a day

avatar image k3nz1e seanbiganski · May 31, 2019 at 10:21 PM 0
Share

@seanbiganski So for instance in one plugins folder i had a plugin called com.android.support.support.annotation-26.1.0.jar and after importing another package i had another plugins folder with support-annotations-26.1.0.jar in it. Same file just duplicated and different name. Deleting one of these solved my issue.

avatar image seanbiganski k3nz1e · Jun 03, 2019 at 07:03 PM 1
Share

Hey I just wanted to follow and say you were right. I was not finding the duplicate files initially because the na$$anonymous$$g convention was changed. In my case, $$anonymous$$apbox was using the file name "support-compat-25.1.0" for example and Firebase was using "com.android.support-compat-26.1.0". Thanks again.

Show more comments
avatar image
0

Answer by pwangweb · Nov 29, 2018 at 06:05 PM

I also encountered the same problem. The release build is fine though. Did you find a fix?,I have encountered the same problem. Did you find a solution?

Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image omaglana · Dec 01, 2018 at 04:42 AM 0
Share

It seems that you cant fix this once this happens to your app the best thing to do is to delete the SD$$anonymous$$ that causes this error and find a newer version/alternative of that. (also you should've have made a backup before installing an SD$$anonymous$$)

avatar image ibrahim000 · Jan 03, 2019 at 03:46 AM 1
Share

I am facing the same exact problem from what I read I understood that there are two different versions of the same library but I can't figure out what library or SD$$anonymous$$ is causing the problem is there a way to do that?

avatar image sj631 ibrahim000 · May 01, 2019 at 05:09 PM 0
Share

Open the Package $$anonymous$$anager window from window tab. Click the "In Project" button if you are in "All packages" mode. Select the package you want to remove from the Packages list. The package information appears in the Details pane. Click the Remove button.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

138 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Error Building Android Project 2 Answers

JNI error when calling Java plugin from System.AppDomain.CurrentDomain.UnhandledException callback handler 0 Answers

Help with error: UnassignedReferenceException 5 Answers

can someone help me with this error please? 1 Answer

Best way to handle exceptions in release 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges