export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
git clone -b dev https://github.com/flutter/flutter.git
export PATH="PATH"
cd /d/flutter
flutter.bat doctor
记得添加环境变量
/d/flutter/bin
FLUTTER_STORAGE_BASE_URL: https://storage.flutter-io.cn
PUB_HOSTED_URL: https://pub.flutter-io.cn
环境变量设置好后要重启电脑
中国flutter设置
https://flutter.dev/community/china
D:\flutter\packages\flutter_tools\gradle\flutter.gradle (设置阿里云代理)
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/' }
//下面两个应该用不上
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
项目的时候卡在了Creating Flutter Project,解决方法:在Android Studio安装目录下的文件夹,找到文件,在最后加上一句:
disable.android.first.run=true
保存,
重启AS,新建flutter项目!