华域联盟 Andriod com.android.support版本冲突解决方法

com.android.support版本冲突解决方法

项目中不同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版本冲突解决方法

转载请保留出处和原文链接:https://www.cnhackhy.com/107833.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

RecyclerView仿应用列表实现网格布局

android开发环境中SDK文件夹下的所需内容详解

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部