sdk 阿里云镜像代理设置
- 首先我们通过设置进入到android sdk 设置界面,选择 SDK Update Sites
2. 点击+ 如上图新增一个 Aliyun Mirror ,地址为 https://developer.aliyun.com/mirror/
gradle 阿里云镜像下载配置
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://mirrors.aliyun.com/macports/distfiles/gradle/gradle-6.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
安卓项目中的仓储的代理配置
// build.gradle
buildscript {
...
repositories {
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
}
dependencies {
classpath("com.android.tools.build:gradle:3.6.0")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://www.jitpack.io' }
}
}