android support library版本冲突问题

方法一:
统一第三方库的library版本:

configurations.all {
    resolutionStrategy.eachDependency { details ->
        if (details.requested.group == 'com.android.support'
                && !details.requested.name.contains('multidex')) {
            details.useVersion "28.0.0"
        }
    }
}

方法二:
指明design的版本。

  implementation 'com.android.support:appcompat-v7:28.0.0'
  implementation 'com.android.support:design:28.0.0'
  implementation 'com.android.support.constraint:constraint-layout:1.1.3'

方法三:
强制指定版本。
在app gradle 中添加如下

configurations.all {
  resolutionStrategy.force "com.android.support:support-v4:$var.supportLibraryVersion"
  resolutionStrategy.force "com.android.support:appcompat-v7:$var.supportLibraryVersion"
  resolutionStrategy.force "com.android.support:design:$var.supportLibraryVersion"
}

你可能感兴趣的:(gradle)