Open twn39 opened 2 years ago
设置环境变量:
export FLUTTER_STORAGE_BASE_URL="https://mirrors.tuna.tsinghua.edu.cn/flutter" export PUB_HOSTED_URL="https://mirrors.tuna.tsinghua.edu.cn/dart-pub"
修改文件地址:...\flutter\packages\flutter_tools\gradle\flutter.gradle
...\flutter\packages\flutter_tools\gradle\flutter.gradle
buildscript { repositories { //google() //mavenCentral() maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/central' } } dependencies { classpath 'com.android.tools.build:gradle:4.1.0' } }
修改项目目录下的 android\build.gradle 文件:
android\build.gradle
buildscript { ext.kotlin_version = '1.6.10' repositories { //google() //mavenCentral() maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/central' } } dependencies { classpath 'com.android.tools.build:gradle:4.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { //google() //mavenCentral() maven { url 'https://mirrors.tuna.tsinghua.edu.cn/flutter/download.flutter.io' } maven { url 'https://maven.aliyun.com/repository/google' } maven { url 'https://maven.aliyun.com/repository/public' } maven { url 'https://maven.aliyun.com/repository/central' } } }
参考:
https://mirrors.tuna.tsinghua.edu.cn/help/flutter/ https://developer.aliyun.com/mirror/maven
设置环境变量:
修改文件地址:
...\flutter\packages\flutter_tools\gradle\flutter.gradle
修改项目目录下的
android\build.gradle
文件:参考:
https://mirrors.tuna.tsinghua.edu.cn/help/flutter/ https://developer.aliyun.com/mirror/maven