-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttere: embedderUsers of the Embedder APIUsers of the Embedder APIengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specifically
Description
The embedder does not appear to work with JIT snapshots on some platforms. In the GLFW example on Linux (which only sets FlutterProjectSettings.asset_path), we get an error that the Dart VM could not be initialized. With gn --unopt --build-embedder-examples:
% $ENGINE_DIR/out/host_debug_unopt/embedder_example $ENGINE_DIR/flutter/examples/glfw/myapp $ENGINE_DIR/third_party/icu/common/icudtl.dat
[ERROR:flutter/runtime/dart_vm_data.cc(18)] VM snapshot invalid and could not be inferred from settings.
[ERROR:flutter/runtime/dart_vm.cc(269)] Could not set up VM data to bootstrap the VM from.
[ERROR:flutter/runtime/dart_vm_lifecycle.cc(84)] Could not create Dart VM instance.
[FATAL:flutter/shell/common/shell.cc(143)] Check failed: vm. Must be able to initialize the VM.
zsh: IOT instruction $ENGINE_DIR/out/host_debug_unopt/embedder_example
We suspect that this is not an issue on Windows and Mac because of this logic: https://github.com/flutter/engine/blob/main/runtime/dart_snapshot.cc#L72
A hack to fix this issue is to add these two lines here:
settings.vm_snapshot_data_path =
fml::paths::JoinPaths({settings.assets_path, "vm_snapshot_data"});
settings.isolate_snapshot_data_path =
fml::paths::JoinPaths({settings.assets_path,
"isolate_snapshot_data"});But we should add proper support to embedder.h.
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Fluttere: embedderUsers of the Embedder APIUsers of the Embedder APIengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-linuxBuilding on or for Linux specificallyBuilding on or for Linux specifically