com.android.support版本冲突的解决方法
导读:本文共678字符,通常情况下阅读需要2分钟。同时您也可以点击右侧朗读,来听本文内容。按键盘←(左) →(右) 方向键可以翻页。
摘要: 项目中不同Module的support包版本冲突怎么办?只需要将以下代码复制到每个模块的build.gradle(Module:xxx)文件的根目录即可:// 统一当前Module的所有support包版本configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetai... ...
目录
(为您整理了一些要点),点击可以直达。项目中不同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版本冲突的解决方法的详细内容,希望对您有所帮助,信息来源于网络。