原文地址https://www.sunzhongwei.com/android-studio-settings-gradle-switching-source-in-china
在项目的根目录下找到settings.gradle文件,然后进行下列更改:
pluginManagement {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'https://maven.aliyun.com/nexus/content/groups/public' }
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
google()
mavenCentral()
}
}
rootProject.name = "MP HandLandmarker"
include ':app'