1.修改 flutter安装目录/packages/flutter_tools/gradle/resolve_dependencies.gradle 文件
// 大约在19行
repositories {
google()
jcenter()
maven {
// 修改处
// url "$storageUrl/download.flutter.io"
url "http://download.flutter.io"
}
}
2.修改 flutter/packages/flutter_tools/gradle/flutter.gradle 文件
buildscript {
repositories {
// 这里做了修改,使用国内阿里的代理
// google()
// jcenter()
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
}
}
// 修改处,大约在44行
// private static final String DEFAULT_MAVEN_HOST = "https://storage.googleapis.com";
private static final String DEFAULT_MAVEN_HOST = "https://storage.flutter-io.cn/download.flutter.io";