現象
Flutterにてfvmを使用してプロジェクトのバージョン管理をしている。
プロジェクトのFlutterのバージョン更新を行っており、新しいバージョンにしたプロジェクトに、古いバージョンの差分を取り込もうとして、マージ作業を行っている。その途中に「Could not find an option named “suppress-analytics”」というエラーが発生するようになった。
解決方法
flutter のキャッシュなど消して、再インストールしたら、動作するようになった。fvmがダウンロードしたFltuterも消した。
rm -rf <path to flutter repo>/bin/cache
rm -rf ~/fvm/versions
dart pub global activate fvm
fvm use
fvm flutter clean
fvm flutter pub getマージ時に、fvm管理下のFlutterに悪さしているのかな?
エラー詳細
fvm flutter pub get
Building flutter tool...
Could not find an option named "suppress-analytics".
Usage: dart pub upgrade [dependencies...]
-h, --help Print this usage information.
--[no-]offline Use cached packages instead of accessing the network.
-n, --dry-run Report what dependencies would change but don't change
any.
--[no-]precompile Precompile executables in immediate dependencies.
--null-safety Upgrade constraints in pubspec.yaml to null-safety
versions
--major-versions Upgrades packages to their latest resolvable versions,
and updates pubspec.yaml.
-C, --directory=<dir> Run this in the directory<dir>.
Run "dart help" to see global options.
See https://dart.dev/tools/pub/cmd/pub-upgrade for detailed documentation.
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
Could not find an option named "suppress-analytics".