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

后续补充:大家遇到这问题的项目是不是都引用kotlin的?目前我跟踪了几个报此错误此解决方式的项目是都满足这条件。知道的同志们评论区探讨吧~

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,292评论 19 139
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 174,896评论 25 709
  • 博客原文链接 Android百大框架排行榜(转) 说明: 无聊写一篇笔记式文章. 精力有限,很多错误之处,受时间与...
    码农朱同学阅读 7,739评论 0 27
  • 生活是婉约派还是抒情派 大概名字就注定 然而生活注定不是诗一样 波折,是因为不够优秀 成长是经历苦痛的旅行 正因为...
    cindyline阅读 1,423评论 0 0
  • 青椒互加为农村教育打开了一扇窗,开启了一扇门,铺就了一条通天大道,把名师,名家送到了农村学校的课堂上。在加入互加的...
    陕县2283阴秀丽阅读 962评论 0 1