随笔 - 123  文章 - 1  评论 - 1  阅读 - 18万 

在升级Flutter SDK时可能会报如下错误:

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.
exit code 1
这是因为在之前下载老版本的Flutter SDK时,其git分支可能在beta版本之下,测试版本与开发版/稳定版有版本差异,此时如果需要升级需要切换到稳定/开发版本之下。

运行``命令,查看当前SDK分支:

1
2
3
4
5
6
$ flutter channel
Flutter channels:
  master
  dev
* beta
  stable

 运行flutter channel stable可以切换至开发版,此时再运行flutter upgrade或者flutter upgrade --force即可进行更新。

posted on   南巷挽清风  阅读(613)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· [AI/GPT/综述] AI Agent的设计模式综述
历史上的今天:
2015-08-28 单例之懒汉式和饿汉式
2015-08-28 java集合类,详解
点击右上角即可分享
微信分享提示