最終解決方案
參考stackoverflow第三個(gè)回答
compile 'com.android.support:appcompat-v7:你當(dāng)前依賴的版本號(hào)'
compile 'com.android.support:design:你當(dāng)前依賴的版本號(hào)'
compile 'com.android.support:cardview-v7:你當(dāng)前依賴的版本號(hào)'
以下是參考文章support中v4 v7庫(kù)版本錯(cuò)誤詳解攀细,被 pass 掉的解決方案如下:
- 排除依賴中的指定包
compile ('com.mcxiaoke.viewpagerindicator:library:x.x.x') {
exclude group: 'com.android.support'
}
- force強(qiáng)制設(shè)置某個(gè)模塊的版本
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:xx.x.x'
}
}
- com.android.support包名的庫(kù)版本都是用你當(dāng)前依賴的版本號(hào)
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '你當(dāng)前依賴的版本號(hào)'
}
}
}
}