Unable to merge dex error [duplicate]

2019-01-20 20:56发布

This question already has an answer here:

This is my app build.gradle file enter image description here

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**

2条回答
太酷不给撩
2楼-- · 2019-01-20 21:04

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

查看更多
祖国的老花朵
3楼-- · 2019-01-20 21:09

Do this-:

implementation 'com.android.support:multidex:1.0.0'

This in your build.gradle-:

multiDexEnabled true

under default config

查看更多
登录 后发表回答