This question already has an answer here:
- Unable to merge dex 59 answers
This is my app build.gradle file
It shows error in the appcompat dependecy file. I tried clean project and build project and so many ways but still the error shows. This is my error when i run project.
**Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex**
Add this to your app.gradle file
android {
defaultConfig {
multiDexEnabled true
}
}
add the dependency also
implementation 'com.android.support:multidex:1.0.0'
it will solve your problem
Do this-:
implementation 'com.android.support:multidex:1.0.0'
This in your build.gradle-:
multiDexEnabled true
under default config
来源:https://stackoverflow.com/questions/48186933/unable-to-merge-dex-error