Android Studio 3.1.2 : Failed to resolve: runtime

前端 未结 4 2008
栀梦
栀梦 2021-02-02 06:58

I have recently updated my Android Studio to 3.1.2 . After the update I tried opening the existing project and was shown multiple gradle errors while compiling the project.

4条回答
  •  长情又很酷
    2021-02-02 07:25

    android.arch.lifecycle:runtime is available at the google maven repository. Make sure you add the repository in the repositories block of your build.gradle

    allprojects {
        repositories {
            jcenter()
            google()
        }
    }
    

    or

    allprojects {
        repositories {
            jcenter()
            maven { url "https://maven.google.com" }
        }
    }
    

    Reference : Adding Components to your Project

提交回复
热议问题