Repository navigation
Wonderous app doesn't launch with a local engine #136931
Copy link
Copy link
Open
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Description
description
Wonderous cannot launch on the iOS simulator with a local engine. I tried both x64 and arm64 versions of the host engine, neither worked.
steps to reproduce
- Download https://github.com/gskinnerTeam/flutter-wonderous-app.git
- Build a local engine
- launch the ios simulator
- Attempt to execute it with
flutter --local-engine=ios_debug_sim_unopt_arm64 --local-engine-host=host_debug_unopt --local-engine-src-path=/Users/aaclarke/dev/engine/src/ run
error
$ ~/bin/flutter-ios-debug-sim-unopt-arm64 run
Resolving dependencies...
cross_file 0.3.3+5 (0.3.3+6 available)
file 6.1.4 (7.0.0 available)
flutter_animate 1.0.0 (4.2.0+1 available)
flutter_lints 2.0.3 (3.0.0 available)
flutter_native_splash 2.3.3 (2.3.4 available)
go_router 6.5.9 (12.0.0 available)
lints 2.1.1 (3.0.0 available)
package_info_plus 5.0.0 (retracted)
petitparser 5.4.0 (6.0.1 available)
share_plus 8.0.0 (retracted)
share_plus_platform_interface 3.3.0 (3.3.1 available)
shared_preferences_linux 2.3.1 (2.3.2 available)
shared_preferences_windows 2.3.1 (2.3.2 available)
uuid 3.0.7 (4.1.0 available)
vector_graphics 1.1.7 (1.1.9 available)
vector_graphics_codec 1.1.7 (1.1.9 available)
vector_graphics_compiler 1.1.7 (1.1.9 available)
xml 6.3.0 (6.4.2 available)
Got dependencies!
16 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Exception: Attempted to generate localizations code without having the flutter: generate flag turned on.
Check pubspec.yaml and ensure that flutter: generate: true has been added and rebuild the project. Otherwise, the localizations source code will not be importable.
Launching lib/main.dart on iPad Air (5th generation) in debug mode...
Running Xcode build...
Xcode build done. 4.2s
Failed to build iOS app
Error (Xcode): Target native_assets failed: Exception: Unsupported MacOS arch name ""
Could not build the application for the simulator.
Error launching application on iPad Air (5th generation).
cc @LouiseHsu
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-iosiOS applications specificallyiOS applications specificallyteam-toolOwned by Flutter Tool teamOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.Issues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.triaged-toolTriaged by Flutter Tool teamTriaged by Flutter Tool team
Activity
gaaclarke commentedon Oct 19, 2023
@dcharkes this sounds related to the feature you are working on?
dcharkes commentedon Oct 20, 2023
Yes, let me take a look.
Edit: I can repro this.
The
flutter assemblecall from xcode contains-dIosArchs=. That is populated byxcode_backend.dartfrom theARCHSenv variable, which is empty.There is a warning in the log with verbose mode:
=> Why is the arm64 target excluded in the Runner project in the Wonderous app?
Without a local engine, the
flutter assemblecall gets-dIosArchs=x86_64. A local engine build targeting x64 works fine as well.$ flutter clean && flutter run -d iPhone --local-engine-src-path=$HOME/flt/engine/src --local-engine=ios_debug_sim_unopt --local-engine-host=host_debug_unopt -v(Which is surprising because I'm running a simulator on an M1, shouldn't that be arm64?)I'll make a PR to not require
-dIosArchson in the NativeAssets target. But instead default to the arch specified in build_info.dart if the parameter is missing.edit 2: after that PR running with the local engine targeting arm64 fails later in the build:
dcharkes commentedon Oct 20, 2023
@gaaclarke
#136948 fixes the issue in native assets, but subsequently the build fails with
Did you mean to use
--local-engine=ios_debug_sim_unopt(x64) instead? It seems that the Wonderous app excludes arm64 in it'sRunner.gaaclarke commentedon Oct 20, 2023
Hmm weird. I don't even know if arm64 xcode has an x64 simulator. Weird that it lists arm64 as the arch but also has it listed as excluded:

I'll play around with it.
Default `NativeAssets` Darwin and IOS target archs if missing (#136948)
gaaclarke commentedon Oct 20, 2023
Okay, I updated the Runner settings so that arm64 is not excluded, x86_x64 is. And I also switched
ONLY_ACTIVE_ARCHto true (which is arm64 in my case). Then the following error happens:That dependency is incorrectly building for x64. @dcharkes Is that the package using native_assets?
settings diff
dcharkes commentedon Oct 21, 2023
No, native assets are in experimental, no package should have been published with native assets.
You have probably not run
flutter config --enable-native-assets, so it should give an error message when any native assets are used.(The
NativeAssetsTargetthat was failing earlier is almost a no-op when the experiment is disabled. But for the sake of the incremental buildsTargets need (1) a stable set of of dependencies and (2) always need to output the same files. So theNativeAssetstarget is always run, and outputs an empty list of dylibs and and empty lookup mapping for the kernel file. That's why we were hitting the code earlier even though the feature is in experimental and likely disabled on your end.)vashworth commentedon Nov 17, 2023
So the Google Maps flutter package does not support arm64 simulator, which is probably why Wonderous fails to build for arm64 simulator.
https://github.com/flutter/packages/blob/a8bb8330c3663d570fcd0950eafdefb501470f22/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec#L27-L28
vashworth commentedon Nov 17, 2023
So what I think is happening when using a local engine is that,
ARCHSgets set in the config to arm64flutter/packages/flutter_tools/lib/src/ios/xcode_build_settings.dart
Lines 201 to 220 in 30b6586
However,
EXCLUDED_ARCHSalso includes arm64flutter/packages/flutter_tools/lib/src/ios/xcode_build_settings.dart
Lines 222 to 232 in a8fbd27
Which will result in resolved
ARCHSduring the build to be null/empty.We could maybe give better messaging about this, but I don't think
ARCHSbeing empty is a bug.vashworth commentedon Nov 17, 2023
@gaaclarke Did you try building engine for x86 simulator? I'm pretty sure arm simulators also accept x86 architecture
matanlurey commentedon Jul 11, 2025
Is this still important?
gaaclarke commentedon Jul 11, 2025
It still reproduces on the latest version of flutter. Wonderous is an important benchmark application for impeller and being able to launch with a local engine is required for any serious debugging. It is not blocking anything I'm working on at the moment, but could be blocking at any moment.
gaaclarke commentedon Jul 11, 2025
In general I would like us to have better integration testing for executing flutter with a local engine. We only have automated testing for standard usage, but executing with a local engine is critical to engine development and breaks for weird reasons from time to time.