项目使用多模块 引入多个库报错:、Android dependency 'com.android.support:support-v4' has different version for the compile (26.1.0) and runtime (28.0.0) classpath. You should manually set the same version via DependencyResolution
方法1
强制修改 项目中 support库 版本号,在项目 build.gradle文件的 android 层级下
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" //这里是版本号 例如:28.0.0
}
}
}
}
方法 2