Flutterをアップグレード(flutter upgrade)しようとしたら「Your flutter checkout has local changes that would be erased by upgrading. If you want to keep・・・」というエラーが出て失敗する場合の対処法 [動画なし]

このページには広告が含まれる場合があります。

 

FlutterのSDKをアップグレードしようと思って、Terminalから

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.

という謎のエラーが出てアップグレードに失敗する場合がありますが、その場合はエラーメッセージの最後にあるように、Terminalから

flutter upgrade --force

で、強制アップグレードすると上手くいきます。

こんな記事も読まれています

【無料】生年月日を入力するだけ!

あなたの知らない「あなた」がわかる
無料診断ツール

あすコロ式
使命・性格タイプ診断

生年月日を入力するだけで144通りの性格パターンを診断。あなたの知らない「本当のあなた(生きる目的・使命)」と「偽りのあなた(無意識の思いグセ)」がわかります!

今すぐ無料で診断する ▶

TOP