Android Studio 支持库版本冲突问题

强制让所有模块都用相同的支持库版本

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

推荐在project下的build.gradle文件中设置support_version值

buildscript {
    ext.support_version = '27.1.0'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        //...
    }
}

你可能感兴趣的:(Android Studio 支持库版本冲突问题)