常遇到android stdio下载依赖超时,配置阿里云的镜像。
android stdio版本:Android Studio Giraffe | 2022.3.1 Patch 2
在setting.gradle文件中配置
使用http地址需要添加 allowInsecureProtocol = true
pluginManagement {
repositories {
maven {
allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
}
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {
allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/groups/public/'
}
maven {
allowInsecureProtocol = true
url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
}
google()
mavenCentral()
}
}