有时候导入一些module时,会出现以下问题

Android dependency 'com.android.support:support-v4' has different version for the compile (23.3.0) and runtime (25.4.0) classpath. You should manually set the same version via DependencyResolution
  • 1

这是因为module中可能依赖了不同的支持库,版本不一样。

解决办法
在项目根目录的build.gradle中加入以下代码
将details.useVersion后的值替换为统一的版本.

subprojects {
    project.configurations.all {
        resolutionStrategy.eachDependency { details ->
            if (details.requested.group == 'com.android.support'
                    && !details.requested.name.contains('multidex') ) {
                //统一版本号
                details.useVersion "25.4.0"
            }
        }
    }
}

相关文章:

  • 2021-11-30
  • 2021-06-18
  • 2021-06-13
  • 2021-08-24
  • 2021-10-14
  • 2021-08-10
  • 2021-11-28
  • 2021-07-09
猜你喜欢
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2021-08-28
  • 2021-12-08
  • 2021-10-12
  • 2021-07-24
相关资源
相似解决方案