Android dependency 'com.android.support:support-v4' has different version for the compile (23.4.0) a

> 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.
  • 1

这是引用了不同版本的v4包造成的。 
如果知道是哪个,一般用下面这个方法就可以

implementation("XXXXX") {
    exclude group: 'com.android.support', module: 'support-compat'
}
  • 1
  • 2
  • 3

如果实在是不知道哪个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'//改这个版本号到你想要的版本
            }
        }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

具体位置示例

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'
            }
        }
    }
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
转载。 https://blog.csdn.net/z19980115/article/details/79805144

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值