Error:Failed to resolve: android.arch.core:common:1.1.0

前端 未结 5 1493
名媛妹妹
名媛妹妹 2020-11-29 04:27

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

5条回答
  •  一整个雨季
    2020-11-29 05:06

    Issue

    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().

    Fix

    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.

提交回复
热议问题