Android Studio 3.0 Execution failed for task: unable to merge dex

前端 未结 26 3521
野性不改
野性不改 2020-11-27 11:52

android studio was getting build error while build execution with following:

Error:Execution failed for task \':app:transformDexArchiveWithExternalLi

26条回答
  •  盖世英雄少女心
    2020-11-27 12:20

    I tried many solutions as mentioned above including the multiDexEnabled true but none of that worked for me.

    Here is the solution which worked for me - copy this code in app\build.gradle file

    configurations.all {
        resolutionStrategy.eachDependency { DependencyResolveDetails details ->
            def requested = details.requested
            if (requested.group == 'com.android.support' && requested.name != 'multidex') {
                details.useVersion "${rootProject.ext.supportLibVersion}"
            }
        }
    }
    

    Make sure to run gradlew clean before running the code

提交回复
热议问题