New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JIT snapshots can't be found on some platforms when just the assets path is specified. #100640
Comments
Specifying just the assets using I am going to retitle this issue as the current wording indicates that JIT snapshots aren't supported at all. When it looks like one use of the API is not able to resolve these snapshots. |
Sorry, I'm having a hard time telling from the implementation: what do I set instead of just |
@chinmaygarde @iskakaushik Sorry to bother you. I was wondering how to use the current embedder API to resolve JIT snapshots as Chinmay mentioned above. Is there a way to modify the flutter::Settings using the embedder API? I thought that was private. |
I launched the Flutter engine on Linux both when only specifying the assets path and when also explicitly specifying the snapshots. Both versions launched successfully on my end as the SearchMapping function was able to resolve the VM and the Isolate snapshots (https://github.com/flutter/engine/blob/5540f885a8064f72890d444ede44e3986c0a69c5/runtime/dart_snapshot.cc#L53). The difference was that, when explicitly specifying the snapshots, SearchMapping would return a file mapping whereas, when only the assets path was specified, it would return a symbol mapping after looking into the native library. Even though both seemed to work fine, I will be implementing a feature to allow users to explicitly specify snapshots. This is also to make the JIT mode be consistent with the existing AOT mode, which allows users to explicitly describe such paths. |
This issue has been addressed in flutter/engine#34244, which allows users to explicitly specify the JIT snapshot locations using the embedder's project args. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
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
: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:
But we should add proper support to embedder.h.
The text was updated successfully, but these errors were encountered: