早上创建项目提示
╔════════════════════════════════════════════════════════════════════════╗
║ A new version of Flutter is available! ║
║ ║
║ To update to the latest version, run "flutter upgrade". ║
╚════════════════════════════════════════════════════════════════════════╝
执行命令
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.
根据提示再次运行
flutter upgrade --force
提示
ProcessException: Process exited abnormally:
fatal: unable to access 'https://github.com/flutter/flutter.git/': Failed to
connect to github.com port 443: Operation timed out
Command: git fetch --tags
搜索解决方案
https://blog.csdn.net/natahew/article/details/81387885
https://blog.csdn.net/qq_43827595/article/details/106547339
看来别人通过修改host文件可以解决
修改前再试一下
flutter upgrade --force
提示升级成功
Downloading darwin-x64-release/FlutterMacOS.framework tools... 1,885ms
Downloading darwin-x64-release tools... 780ms
Downloading darwin-x64/font-subset tools... 1,040ms
Flutter 2.0.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 4d7946a68d (8 days ago) • 2021-03-18 17:24:33 -0700
Engine • revision 3459eb2436
Tools • Dart 2.12.2
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.3, on macOS 11.2.3 20D91 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.1)
[✓] VS Code (version 1.54.3)
[✓] Connected device (3 available)
• No issues found!