三、Android Studio打开项目 Gradle Download:https://jcenter.bintray.com/一直加载最终超时解决方案

1、问题产生的原因?

    因为要下载的文件需要翻墙。

2、解决的方法

    修改项目根目录下 build.gradle 文件,将 jcenter() 或者 mavenCentral() 替换掉即可。可以用国内的仓库代替:

    阿里的仓库地址:http://maven.aliyun.com/nexus/content/groups/public/

    OSChina的仓库地址:http://maven.oschina.net/content/groups/public/

注意:必须注释掉 jcenter()。

repositories {

google()

//        jcenter()

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

}

allprojects {

repositories {

google()

maven {url"https://maven.google.com" }

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

//        jcenter() 

}

}


如图配置就行了,问题完美解决!

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

推荐阅读更多精彩内容