Flutter新建项目时遇到Because flutterapp

2020-11-17  本文已影响0人  HMZZS

新建一个flutter项目的时候,报了一个这样的错误:

D:\>flutter create demo
Recreating project D:\demo...
Because demo depends on cupertino_icons any which doesn't exist (could not find package cupertino_icons at https://storage.flutter-io.cn), version solving failed.
pub get failed (server unavailable) -- attempting retry 1 in 1 second...
Because demo depends on cupertino_icons any which doesn't exist (could not find package cupertino_icons at https://storage.flutter-io.cn), version solving failed.
pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...
Because demo depends on cupertino_icons any which doesn't exist (could not find package cupertino_icons at https://storage.flutter-io.cn), version solving failed.
pub get failed (server unavailable) -- attempting retry 3 in 4 seconds...
Running "flutter pub get" in demo...

问题的解决方案

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

把上面添加到用户变量里面如下图所示

环境变量
上一篇 下一篇

猜你喜欢

热点阅读