Android Architecture Components 下载依赖失败

最近想要 研究####Android Architecture Components 奈何本地的gradle一直拉不下源码,尝试切换到云服务器编译,依然落不下代码 提示错误

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
   > Could not resolve android.arch.persistence.room:runtime:1.0.0-alpha3.
     Required by:
         project :app
      > Could not resolve android.arch.persistence.room:runtime:1.0.0-alpha3.
         > Could not get resource 'https://maven.google.com/android/arch/persistence/room/runtime/1.0.0-alpha3/runtime-1.0.0-alpha3.pom'.
            > Could not HEAD 'https://maven.google.com/android/arch/persistence/room/runtime/1.0.0-alpha3/runtime-1.0.0-alpha3.pom'.
               > Connect to maven.google.com:443 [maven.google.com/216.58.200.46] failed: Connection timed out: connect
   > Could not resolve android.arch.lifecycle:common:1.0.0-alpha3.
     Required by:
         project :app > android.arch.lifecycle:runtime:1.0.0-alpha3
         project :app > android.arch.lifecycle:extensions:1.0.0-alpha3
      > Could not resolve android.arch.lifecycle:common:1.0.0-alpha3.
         > Could not get resource 'https://maven.google.com/android/arch/lifecycle/common/1.0.0-alpha3/common-1.0.0-alpha3.pom'.
            > Could not HEAD 'https://maven.google.com/android/arch/lifecycle/common/1.0.0-alpha3/common-1.0.0-alpha3.pom'.
               > Connect to maven.google.com:443 [maven.google.com/216.58.200.46] failed: Connection timed out: connect

思来想去,还是没找到原因,本身网络是自带翻墙梯子的,后来看到很多人在Google issue提问题,也是无法下载依赖库
后来尝试翻看 https://developer.android.com/studio/build/dependencies.html 找到了答案,Google 建议将

https://maven.google.com
替换为 https://dl.google.com/dl/android/maven2/

答案解析 https://developer.android.com/studio/build/dependencies.html

repositories {
    maven {
        url 'https://maven.google.com'
        // Alternative URL is 'https://dl.google.com/dl/android/maven2/'
    }
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值