com.android.support版本冲突的解决方法(android,com,support,编程语言)

时间:2024-04-28 19:45:09 作者 : 石家庄SEO 分类 : 编程语言
  • TAG :

    com.android.support%E7%89%88%E6%9C%AC%E5%86%B2%E7%AA%81%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95

项目中不同Module的support包版本冲突怎么办?

只需要将以下代码复制到每个模块的build.gradle(Module:xxx)文件的根目录即可:

// 统一当前Module的所有support包版本configurations.all {

resolutionStrategy.eachDependency { DependencyResolveDetails details ->

def requested = details.requested

if (requested.group == 'com.android.support') {

if (!requested.name.startsWith("multidex")) {

details.useVersion '28.0.0'

} } }}

模板代码如下:

apply plugin: 'com.android.application'android { compileSdkVersion 28 defaultConfig { ... } buildTypes { ... } lintOptions { ... }}dependencies { ...}configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details ->

def requested = details.requested

if (requested.group == 'com.android.support') {

if (!requested.name.startsWith("multidex")) {

details.useVersion '28.0.0'

} } }}

本文:com.android.support版本冲突的解决方法的详细内容,希望对您有所帮助,信息来源于网络。
上一篇:Python如何实现多项式回归下一篇:

5 人围观 / 0 条评论 ↓快速评论↓

(必须)

(必须,保密)

阿狸1 阿狸2 阿狸3 阿狸4 阿狸5 阿狸6 阿狸7 阿狸8 阿狸9 阿狸10 阿狸11 阿狸12 阿狸13 阿狸14 阿狸15 阿狸16 阿狸17 阿狸18