JCenter下載太慢?教你修改Maven倉庫地址爲國內鏡像

解決方法一:

https:改成 http協議下載

下文介紹部分來源自:https://my.oschina.net/lifj/blog/754861

下面是build.gradle的內容:主要增加了jcenter(){url 'http://jcenter/bintray.com/'} 

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter(){ url 'http://jcenter.bintray.com/'}
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter(){url 'http://jcenter.bintray.com/'}
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

希望能幫到大家。

解決方法二:

改成開源中國maven鏡像,這個方法沒試過,不知道好不好用,需要的同學,可以自行測試

http://blog.csdn.net/biezhihua/article/details/49668605

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章