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' } } } }

以上就是相关全部知识点内容,感谢大家的学习和对html中文网的支持。

以上就是com.android.support版本冲突解决方法的详细内容,更多请关注0133技术站其它相关文章!

赞(0) 打赏
未经允许不得转载:0133技术站首页 » 移动