Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了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版本冲突解决方法全部内容,希望文章能够帮你解决com.android.support版本冲突解决方法所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:版本冲突