现在的位置: 首页 > 编程语言 > 正文

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

2020年02月13日 编程语言 ⁄ 共 842字 ⁄ 字号 评论关闭

项目中不同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版本冲突解决方法的相关介绍,要了解更多com.android.support,版本冲突内容请登录学步园。

抱歉!评论已关闭.