集成flutter错误:VM snapshot must be
2019-04-16 本文已影响3人
MDZZ灭顶之灾12138
E/flutter: [ERROR:flutter/runtime/dart_vm.cc(265)] VM snapshot must be valid.
A/flutter: [FATAL:flutter/shell/common/shell.cc(208)] Check failed: vm. Must be able to initialize the VM.
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 20133 (m.dbn.OAConnect)
assets 目录会缺少 flutter_shared 资源。在打包的时候没有把 flutter.jar 中 assets 资源合并到项目的 assets 中。flutter_shared 文件夹中有一个非常重要的 icudtl.dat 文件
modify packages/flutter_tools/gradle/flutter.gradle
最终解决了@jelenalecic
- Import flutter module to your HOST app(set binding, implementation, and instantiate view/fragment)
- When you clean/rebuild from HOST app, flutter module does not generate properly
- You need to open your flutter module in a separate AS
- flutter clean
- cd .android
- gradlew clean
- gradlew assembleDebug
- Return to host app and run app(do not sync or rebuild) :)