有時候導入一些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" } } } }