All com.android.support libraries must use the exact same version specification

前端 未结 30 2158
忘掉有多难
忘掉有多难 2020-11-21 05:10

After updating to android studio 2.3 I got this error message. I know it\'s just a hint as the app run normally but it\'s really strange.

All com.andr

30条回答
  •  攒了一身酷
    2020-11-21 05:58

    Add this to the very end of your build.gradle (Module:app):

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

    Make sure that you replace '25.3.1' with the version of the android support library that you want to use for all the dependencies , it should not be lower than your complile sdk version

    than re sync gradle

提交回复
热议问题