たろすの技術メモ

Jot Down the Tech

ソフトウェアエンジニアのメモ書き

Can't load Kernel binary: Invalid kernel binary format version.を解消する

stackoverflow.com

ある時から$ flutter ~ コマンドを実行するとこのログが出るようになったので原因と解決方法を調べました。

開発環境

  • 13.4.1(22F82)
  • Intel Iris Plus Graphics 1536 MB
$ fvm flutter --version
Flutter 3.0.4 • channel unknown • unknown source
Framework • revision 85684f9300 (12 months ago) • 2022-06-30 13:22:47 -0700
Engine • revision 6ba2af10bb
ToolsDart 2.17.5DevTools 2.12.2

$ flutter pub cache repairで直りました。

$ flutter pub cache repairとは

You can perform a clean reinstallation of all packages in your system cache:

$ dart pub cache repair

This command can be useful when packages in your system cache are somehow changed or broken.

For example, some editors make it easy to find implementation files for packages in the system cache, and you might accidentally edit one of those files.

日本語訳

システムキャッシュにあるすべてのパッケージのクリーンな再インストールを実行できます:

このコマンドは、システムキャッシュにあるパッケージが何らかの理由で変更され たり壊れたりした場合に便利です。

例えば、エディタによってはシステムキャッシュにあるパッケージの実装ファ イルを簡単に見つけることができますが、そのようなファイルを誤って編集してしまうかもしれません。

dart.dev