Could not resolve all files for configuration ':debugCompileClasspath'. > Could not find runtime....

假期回来打开电脑更新一下项目,结果就出现了下面这个问题:

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

结果添加如下所示之后各种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()

最终结果如下这样,再rebuild一下就解决了

allprojects {
    repositories {
        mavenLocal()
        maven {
            url "https://maven.google.com"
        }
        maven { url 'https://jitpack.io' }
        jcenter()
    }
}
    原文作者:筱宓dawnLing
    原文地址: https://www.jianshu.com/p/9de30197b528
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞