Unable to merge dex

前端 未结 30 2750
深忆病人
深忆病人 2020-11-21 22:14

I have Android Studio Beta. I created a new project with compile my old modules but when I tried launching the app it did not launch with the message:

Error:         


        
30条回答
  •  难免孤独
    2020-11-21 22:56

    I tried every other solution, but no one worked for me. At the end, i solved it by using same dependency version by editing build.gradle. I think this problem occurres when adding a library into gradle which uses different dependency version of support or google libraries.

    Add following code to your build gradle file. Then clean and rebuild project.

    ps: that was old solution for me so you should use updated version of following libraries.

    configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '26.1.0'
            }
        } else if (requested.group == "com.google.android.gms") {
            details.useVersion '11.8.0'
            } else if (requested.group == "com.google.firebase") {
                details.useVersion '11.8.0'
              }
          }
    }
    

提交回复
热议问题