🐗

FirebaseCLIが使えなくなった!

2023/03/12に公開

Flutter3.7.7にバージョンアップした影響?

Flutterをアップグレードしたら、Firebase CLIが使えなくなってしまった😱

ターミナルでコマンドを実行したときに表示されたログ

Can't load Kernel binary: Invalid kernel binary format version.
Could not find a file named "pubspec.yaml" in "/Users/hashimotojunichi/.pub-cache/hosted/pub.dev/flutterfire_cli-0.2.2+2".

日本語に翻訳
カーネルバイナリをロードできません。無効なカーネル・バイナリ・フォーマットのバージョンです。
pubspec.yaml」という名前のファイルが「/Users/hashimotojunichi/.pub-cache/hosted/pub.dev/flutterfire_cli-0.2.2+2」内に見つかりませんでした。

こちらのissueを参考に解決策を考えてみた
https://github.com/firebase/flutterfire/issues/10375

Firebase CLIをインストールし直すと治った!
https://firebase.flutter.dev/docs/overview

# Install the CLI if not already done so
dart pub global activate flutterfire_cli

# Run the `configure` command, select a Firebase project and platforms
flutterfire configure

まとめ

バージョンアップしたときに、cocoa podsをインストールし直して、くださいとエラーログが出てきたり、パッケージを再インストールすると、よく起きる問題は解決できそうです。

Flutter大学

Discussion