Upgrading Flutter卡住不动解决方法
- 发表于
- flutter
Flutter upgrade更新无响应
运行命令看到flutter提示有更新:
1 2 3 |
➜ xx (master) ✗ flutter run A new version of Flutter is available! To update to the latest version, run "flutter upgrade". |
执行更新报错:
1 2 3 |
$ flutter upgrade Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is recommended that you stash them via "git stash" or else commit the changes to a local branch. If it is okay to remove local changes, then re-run this command with --force. |
修改命令:
1 2 3 4 5 6 7 |
$ flutter upgrade --force Downloading Dart SDK from Flutter engine b6b54fd60631a3828c2e2c9b079b5d1d2d8c8c37... % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 200M 100 200M 0 0 1903k 0 0:01:47 0:01:47 --:--:-- 2021k Building flutter tool... Upgrading Flutter from /Users/xx/flutter... |
然后就这样,卡着不动了。
解决方法
- 进入
flutter\bin
目录下,双击flutter.bat
文件,或运行flutter
文件,下载windows/mac需要的系统依赖,从新回到终端,运行flutter upgrade
。 - 挂上代理尝试,因为涉及到下载所需的pub包和编译开发工具,有些地区会无法访问pub。时间有点久,快的几分钟,慢的可能会出现10分钟左右。
原文连接:Upgrading Flutter卡住不动解决方法
所有媒体,可在保留署名、
原文连接
的情况下转载,若非则不得使用我方内容。