今天重裝系統(tǒng)后,as運行一直報 Unknown host 'jcenter.bintray.com' 錯誤,
百度后發(fā)現是連接不上沒法下載倉庫文件科汗,可惡的墻。-_-||
解決方法:
使用阿里云倉庫服務绷雏、
在根目錄下build.gradle 添加 maven { url 'https://maven.aliyun.com/repository/jcenter'}
然后build 一下肛捍、就可以 了
repositories {
maven { url 'https://maven.aliyun.com/repository/jcenter'}
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/jcenter'}
google()
jcenter()
maven { url "https://jitpack.io" }
}
}