昨天項(xiàng)目莫名崩潰恋技,打開某燈翻墻更新屢次被攔截智袭,下載著突然就被斷掉了,無法正常更新gradle及其依賴組件础拨,早年寫東西知道淘寶有鏡像氮块,百度了一下阿里鏡像Android,一搜博客甚多欣然引用诡宗,然都是過時(shí)的滔蝉,作者也不作更改,一幕幕爆紅塔沃,還以為配置有誤蝠引,耽誤半天,后來自己親自去官網(wǎng)更新查找并配置,無問題立肘,順帶提一句百度搜索引擎里“搜索目標(biāo)”+“空格鍵”+“-CSDN”可以屏蔽掉大多數(shù)CSDN的坑边坤,這個(gè)網(wǎng)站已經(jīng)變質(zhì)成為開發(fā)者的攔路虎!
配置分享如下:
居官方配置之上無需刪除谅年,其按順序執(zhí)行
buildscript {
ext.kotlin_version = '1.2.0'
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }//jcenter
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }//gradle-plugin
maven { url 'https://maven.aliyun.com/repository/central' }//central
maven { url 'https://maven.aliyun.com/repository/google' }//google
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }//jcenter
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }//gradle-plugin
maven { url 'https://maven.aliyun.com/repository/central' }//central
maven { url 'https://maven.aliyun.com/repository/google' }//google
jcenter()
maven { url 'https://jitpack.io' }
google()
flatDir{
dirs 'libs'//A依賴B茧痒,B依賴C,要想A能訪問C的libs融蹂,就得添加這個(gè)
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}