Android 項目突然接盤,以前的項目有多個依賴包,現(xiàn)需要對以前的項目 進(jìn)行重新修改。出現(xiàn)了 以下問題
Android dependency 'android.arch.lifecycle:livedata-core' has different version for the compile (1.1.0) and runtime (1.1.1) classpath. You should manually set the same version via DependencyResolution。
也曾挨著修改過各依賴包的build.gradle,沒有任何卵用,可能是沒有修改正確,多方查找 終于讓自己找到解決辦法。
無視module,直接在工程的build.gradle中添加配置:
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion '25.1.0'//這個版本號設(shè)置為你想要的版本
}
}
}
}