运行卡在flutter packages get: running…

F5调试的时候 卡在 flutter packages get: running… 好久,看输出日志 应该是官网北墙,官方也注意到了这个问题.

提供了中国的镜像,我们只需新增系统变量 PUB_HOSTED_URL 和 FLUTTER_STORAGE_BASE_URL 两个参数,并分别设置URL 即可.

PUB_HOSTED_URL=https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

设置完毕执行:

flutter doctor

 

下面是linux操作办法

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="$PWD/flutter/bin:$PATH"
cd ./flutter
flutter doctor

参考:https://flutter.dev/community/china

发表评论

您的电子邮箱地址不会被公开。