假期回來打開電腦更新一下項目喷市,結(jié)果就出現(xiàn)了下面這個問題:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':debugCompileClasspath'.
> Could not find runtime.jar (android.arch.lifecycle:runtime:1.0.0).
Searched in the following locations:
https://jcenter.bintray.com/android/arch/lifecycle/runtime/1.0.0/runtime-1.0.0.jar
各種百度說要添加maven { url 'https://maven.google.com' }這句話:
allprojects {
repositories {
mavenLocal()
maven { url 'https://maven.google.com' } // <-- add this!
jcenter()
}
結(jié)果添加如下所示之后各種rebuild沒效果
allprojects {
repositories {
jcenter()
mavenLocal()
maven {
url 'https://maven.google.com'
name 'Google'
}
maven {
url "https://maven.google.com"
}
maven { url 'https://jitpack.io' }
}
}
最終解決jcenter()一定要放在最后面才可以顿天。黑人式問號?颇象??
坑爹啊~一臉懵逼
// keep this at the end
jcenter()
最終結(jié)果如下這樣柬脸,再rebuild一下就解決了
allprojects {
repositories {
mavenLocal()
maven {
url "https://maven.google.com"
}
maven { url 'https://jitpack.io' }
jcenter()
}
}
后續(xù)補(bǔ)充:大家遇到這問題的項目是不是都引用kotlin的嚼酝?目前我跟蹤了幾個報此錯誤此解決方式的項目是都滿足這條件。知道的同志們評論區(qū)探討吧~