Flutter 错误 - 无效的内核二进制格式版本(发现 4,预期 6)

Cha*_*air 4 upgrade dart flutter

在升级颤动后运行我的应用程序时,我收到此错误。

error: Invalid kernel binary format version (found 4, expected 6)

我目前处于master, I tried switch the branch to测试阶段。还是没有帮助。这是堆栈跟踪。

2018-05-28 15:22:46.214821+0530 Runner[579:57143] ../../third_party/dart/runtime/vm/kernel_binary.cc: 39: error: Invalid kernel binary format version (found 4, expected 6)
2018-05-28 15:22:46.214912+0530 Runner[579:57143] Dumping native stack trace for thread 7c03
2018-05-28 15:22:46.237923+0530 Runner[579:57143]   [0x0000000100fda4a0] dart::Profiler::DumpStackTrace(void*)
2018-05-28 15:22:46.239415+0530 Runner[579:57143]   [0x0000000100fda4a0] dart::Profiler::DumpStackTrace(void*)
2018-05-28 15:22:46.271484+0530 Runner[579:57143]   [0x0000000000000000] Unknown symbol
2018-05-28 15:22:46.273617+0530 Runner[579:57143]   [0x0000000100eda158] dart::kernel::Program::ReadFromBuffer(unsigned char const*, long, bool)
2018-05-28 15:22:46.273681+0530 Runner[579:57143] -- End of DumpStackTrace
Run Code Online (Sandbox Code Playgroud)

这是 的输出flutter doctor

Running flutter doctor... Doctor summary (to see all details, run flutter doctor -v): [?] Flutter (Channel master, v0.4.5-pre.98, on Mac OS X 10.13.3 17D47, locale en-IN) [?] Android toolchain - develop for Android devices
    ? Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
      If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location. [?] iOS toolchain - develop for iOS devices (Xcode 9.2) [?] Android Studio (not installed) [?] IntelliJ IDEA Community Edition (version 2017.3.5) [?] Connected devices (3 available)

! Doctor found issues in 2 categories.
Run Code Online (Sandbox Code Playgroud)

可能有什么问题?请帮忙。

小智 6

修复:删除你的 Flutter 安装目录下的 bin/cache 目录,然后运行 ​​flutter doctor 再试一次。通常,它将是 C:\src\flutter。

如果需要,升级颤振。

  • 删除 bin/cache 目录后,运行“flutter doctor”是不够的。您也需要运行“flutter precache”。 (3认同)

Vya*_*rov 2

尝试一下flutter clean- 文件夹中似乎有一些陈旧的工件build/