android studio引用远程仓库无法下载问题(jcenter)

问题: 同步项目,遇到Jcenter 仓库无法下载,报错如下

Could not GET 'https://jcenter.bintray.com/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar'.
  1. 添加 jcenter
  • 修改项目根目录的 build.gradle 文件
buildscript {
.....
    repositories {
        google()
        jcenter {
            url "http://jcenter.bintray.com"
        }
    }
......
}
......

allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter {
            url "http://jcenter.bintray.com"
        }
    }
}
  1. 使用阿里镜像(下载快,推荐)

android studio引用远程仓库无法下载问题(jcenter)_第1张图片

buildscript {
.....
    repositories {
       maven { url 'https://maven.aliyun.com/repository/google' }
       maven{ url 'https://maven.aliyun.com/repository/jcenter'}    

    }
......
}
......

allprojects {
    repositories {
       maven { url 'https://maven.aliyun.com/repository/google' }
       maven{ url 'https://maven.aliyun.com/repository/jcenter'}    
    }
}

你可能感兴趣的:(坑)