Android镜像配置

2024-07-20  本文已影响0人  上帝潦倒

1、gradle-wrapper.properties

使用腾讯镜像 https://mirrors.cloud.tencent.com/gradle/

比如用 distributionUrl=https://mirrors.cloud.tencent.com/gradle/gradle-7.3.3-bin.zip
替换 distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

2、build.gradle或settings.gradle

使用阿里云镜像 https://maven.aliyun.com,在pluginManagement、dependencyResolutionManagement或buildscript、allprojects代码块里添加:

repositories {
    maven { url 'https://maven.aliyun.com/repository/central' }
    maven { url 'https://maven.aliyun.com/repository/public'}
    maven { url 'https://maven.aliyun.com/repository/google'} //替换google()
    maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
}
上一篇下一篇

猜你喜欢

热点阅读