新建flutter项目获取不到package踩坑记录

问题描述:

got socket error trying to find package cupertino_icons at https://pub.dary....
pub get failed (69) -- attempting retry 8 in 64 seconds...

问题解决:

我用的是win7,在环境变量 -> 用户变量中添加了这2个变量:

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

新建flutter项目获取不到package踩坑记录

重新创建项目:

vscode: ctrl+shift+p --> flutter create
命令行: flutter create 项目名(只能小写字母和下划线组合)

相关推荐