SDK upgrade of Mac computer flutter

insert image description here

  • Before the upgrade, it was version 1.12.13, and now I want to upgrade to version 2 of flutter
  • View branch
flutter channel

insert image description here

  • It should be noted here that the package of which branch will be updated when which branch is updated
  • run update
flutter upgrade
  • report an error
    insert image description here
  • I checked a lot of online saying to switch to the dev (flutter channel dev) branch and then force the update, but if I want to download the stable version, I don't switch the branch, and force the update directly
  • Force an update to run
flutter upgrade --force
  • At this time, if the network is not good, it will be stuck and it will not continue. I have been running this command, and the rest of the configuration has not changed. It happened that the update was successful when the network was good.
  • insert image description here
  • The following screen appears, the installation is successful
  • Then run flutter doctor and flutter --version and the version number appears and you are done
  • insert image description here

Guess you like

Origin blog.csdn.net/weixin_43794749/article/details/118391805