在Android Studio和Xcode中运行flutter应用程序时出错

时间:2018-09-20 14:22:16

标签: xcode android-studio dart flutter

从Beta频道切换到master频道后,当我尝试在android studio或Xcode中运行Flutter应用程序时,都会遇到此错误:

2018-09-20 15:18:16.711602+0100 Runner[7370:3358571] ../../third_party/dart/runtime/vm/kernel_binary.cc: 39: error: Invalid kernel binary format version (found 5, expected 7)
2018-09-20 15:18:16.711665+0100 Runner[7370:3358571] Dumping native stack trace for thread 9e03
2018-09-20 15:18:16.735476+0100 Runner[7370:3358571]   [0x00000001056f5d64] dart::Profiler::DumpStackTrace(void*)
2018-09-20 15:18:16.735963+0100 Runner[7370:3358571]   [0x00000001056f5d64] dart::Profiler::DumpStackTrace(void*)
2018-09-20 15:18:16.736001+0100 Runner[7370:3358571]   [0x0000000000000000] Unknown symbol
2018-09-20 15:18:16.737556+0100 Runner[7370:3358571]   [0x00000001055f7378] dart::kernel::Program::ReadFromBuffer(unsigned char const*, long, bool)
2018-09-20 15:18:16.737589+0100 Runner[7370:3358571] -- End of DumpStackTrace

这是我扑扑的医生:

    [✓] Flutter (Channel master, v0.9.3-pre.3, on Mac OS X 10.13.4 17E199, locale en-GB)
    • Flutter version 0.9.3-pre.3 at /Users/heyab/flutter
    • Framework revision 8b5af14f24 (17 hours ago), 2018-09-19 15:42:51 -0700
    • Engine revision 2e8e96fad1
    • Dart version 2.1.0-dev.4.0.flutter-4eb879133a

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at ....
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.4.1, Build version 9F2000
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 24.2.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] Connected devices (2 available)


• No issues found!

有人可以帮我吗?

1 个答案:

答案 0 :(得分:0)

我已经设法解决了这个问题:通过转到“构建阶段”->“运行脚本”并添加: / bin / sh“ $ FLUTTER_ROOT / packages / flutter_tools / bin / xcode_backend.sh”构建  然后取消勾选“仅在安装时运行脚本”->代码清理->生成项目->现在可以正常使用了! :)