My system suddenly went off and I switched it on and I got Error:Failed to resolve: android.arch.core:common:1.1.0 error in my android studio. I have tried clean and rebuild
In the past few weeks some Google Android libraries on jcenter have gone missing, causing errors like yours.
Example:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find common.jar (android.arch.core:common:1.1.0). Searched in the following locations:
https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar
jcenter's maven-metadata.xml is still valid and contains versions which is causing gradle to assume the listed files are there and will try to download them without falling back to https://maven.google.com/
. Even if you have this or google()
next in your build.gradle
, under jcenter()
.
In your root build.gradle
make sure google()
is before jcenter()
.
repositories {
google()
jcenter()
}
In most projects you will have to update this in 2 spots.
buildscript {
repositories {
google()
jcenter()
}
}
allprojects {
repositories {
google()
jcenter()
}
}
Note: Use maven { url "https://maven.google.com" }
instead of google()
if your Gradle version is less than 4.0.