> Android dependency 'com.android.support:support-v4' has different version for the compile (23.4.0) and runtime (27.1.0) classpath. You should manually set the same version via DependencyResolution
Android dependency 'com.android.support:support-support-v4' has different version for the compile (23.1.1) and runtime (27.1.0) classpath. You should manually set the same version via DependencyResolution.
这是引用了不同版本的v4包造成的。
如果知道是哪个,一般用下面这个方法就可以
implementation("XXXXX") {
exclude group: 'com.android.support', module: 'support-compat'
}
如果实在是不知道哪个Library引用的,可以用下面这个方法,放在project 的build.gradle 下
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion '27.1.0'//改这个版本号到你想要的版本
}
}
}
}
具体位置示例
buildscript {
dependencies {
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
mavenCentral()
maven { url 'https://maven.google.com' }
google()
}
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion '27.1.0'
}
}
}
}