build.gradle 默认的仓库为
buildscript {
。。。。。。。
repositories {
google()
jcenter()
}
。。。。。。。
}
使用起来非常不便。于是将源换成阿里云的源,
打开 https://maven.aliyun.com,会转到https://maven.aliyun.com/mvn/view
选择几个加入到配置文件就可以。
buildscript {
。。。。。。。
repositories {
maven { url 'https://maven.aliyun.com/repository/jcenter' }
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' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'https://maven.aliyun.com/reposito

本文介绍了如何将Gradle的默认仓库切换到阿里云的镜像源,以提高下载速度。通过访问阿里云Maven仓库并选择合适的镜像,更新build.gradle或flutter安装目录下的flutter.gradle文件,将原有仓库地址替换为阿里云的镜像地址。
最低0.47元/天 解锁文章
4125

被折叠的 条评论
为什么被折叠?



