記録用ブログ

個人的な記録のためのブログ。主にソフトウェアテストの話題。

flutterのパスを変更した後にAndroid Studioでエラー

Android Studioを新しいパソコンにインストール、FlutterとDartプラグインもインストールした。
その後、別のパソコンで作ったflutterプロジェクトをインポートしたら、importがすべて失敗していてこんなエラーが出ていた。

Warning! This package referenced a Flutter repository via the .packages file that is no longer available. The repository from which the 'flutter' tool is currently executing will be used instead.
(略:ここにflutterのパスが書かれていた)
This can happen if you deleted or moved your copy of the Flutter repository, or if it was on a volume that is no longer mounted or has been mounted at a different location. Please check your system path to verify that you are running the expected version (run 'flutter --version' to see which flutter is on your path).

パソコンを変えるにあたってflutterのパスを変更していたので、それが原因のようだ。

試したこと:
* 環境変数を見てflutterにPATHが通っているのを確認してからAndroid Studioを再起動 →ダメ
* FlutterとDartプラグインを再インストール →OK。これでエラーが消えた