gradle下载慢
修改gradle-wrapper.properties
替换https://services.gradle.org/distributions为https://mirrors.cloud.tencent.com/gradle
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
gradle依赖包下载慢
修改settings.gradle.kts
pluginManagement {
repositories {
// 使用阿里镜像源
maven(url = "https://maven.aliyun.com/repository/google")
maven(url = "https://maven.aliyun.com/repository/central")
maven(url = "https://maven.aliyun.com/repository/gradle-plugin")
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
// 使用阿里镜像源
maven(url = "https://maven.aliyun.com/repository/google")
maven(url = "https://maven.aliyun.com/repository/central")
google()
mavenCentral()
}
}
rootProject.name = "My Application"
include(":app")
参考
https://blog.csdn.net/moresi/article/details/136206437
https://developer.aliyun.com/mvn/guide