答案 0 :(得分:3)
将此代理信息添加到您的gradle.properties文件中:
systemProp.https.proxyPort=9595
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=9595
并在psiphone之类的vpn中设置高于代理端口(例如9595)。然后同步项目。
将mavenCentral()
添加到您的build.gradle
项目中,如下所示:
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven {
name 'Sonatype SNAPSHOTs'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
google()
maven { url 'https://jitpack.io' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
flatDir {
dirs 'libs'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
请参阅此post。