Skip to content

Wonderous app doesn't launch with a local engine #136931

Open

Description

@gaaclarke

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

  1. Download https://github.com/gskinnerTeam/flutter-wonderous-app.git
  2. Build a local engine
  3. launch the ios simulator
  4. 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

Activity

  1. added
    platform-iosiOS applications specifically
    engineflutter/engine related. See also e: labels.
    on Oct 19, 2023
  2. gaaclarke commented on Oct 19, 2023

    @gaaclarke
    MemberAuthor

    @dcharkes this sounds related to the feature you are working on?

  3. dcharkes commented on Oct 20, 2023

    @dcharkes
    Contributor

    Error (Xcode): Target native_assets failed: Exception: Unsupported MacOS arch name ""

    Yes, let me take a look.

    Edit: I can repro this.

    The flutter assemble call from xcode contains -dIosArchs= . That is populated by xcode_backend.dart from the ARCHS env variable, which is empty.

    There is a warning in the log with verbose mode:

    warning: None of the architectures in ARCHS (arm64) are valid. Consider setting ARCHS to $(ARCHS_STANDARD) or updating it to include at least one value from VALID_ARCHS (arm64, arm64e, i386, x86_64) which is not in EXCLUDED_ARCHS (i386, arm64). (in target 'Runner' from project 'Runner')
    

    => Why is the arm64 target excluded in the Runner project in the Wonderous app?

    Without a local engine, the flutter assemble call 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 -dIosArchs on 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:

                [   +5 ms] Target debug_unpack_ios failed: Exception: Binary /Users/dacoharkes/src/gskinnerTeam/flutter-wonderous-app/build/ios/Debug-iphonesimulator/Flutter.framework/Flutter does not contain . Running lipo -info:
                           Non-fat file: /Users/dacoharkes/src/gskinnerTeam/flutter-wonderous-app/build/ios/Debug-iphonesimulator/Flutter.framework/Flutter is architecture: arm64
    
  4. dcharkes commented on Oct 20, 2023

    @dcharkes
    Contributor

    @gaaclarke

    #136948 fixes the issue in native assets, but subsequently the build fails with

                [   +5 ms] Target debug_unpack_ios failed: Exception: Binary /Users/dacoharkes/src/gskinnerTeam/flutter-wonderous-app/build/ios/Debug-iphonesimulator/Flutter.framework/Flutter does not contain . Running lipo -info:
                           Non-fat file: /Users/dacoharkes/src/gskinnerTeam/flutter-wonderous-app/build/ios/Debug-iphonesimulator/Flutter.framework/Flutter is architecture: arm64
    

    Did you mean to use --local-engine=ios_debug_sim_unopt (x64) instead? It seems that the Wonderous app excludes arm64 in it's Runner.

  5. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    team-toolOwned by Flutter Tool team
    on Oct 20, 2023
  6. gaaclarke commented on Oct 20, 2023

    @gaaclarke
    MemberAuthor

    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:
    Screenshot 2023-10-20 at 9 25 00 AM

    I'll play around with it.

  7. gaaclarke commented on Oct 20, 2023

    @gaaclarke
    MemberAuthor

    Okay, I updated the Runner settings so that arm64 is not excluded, x86_x64 is. And I also switched ONLY_ACTIVE_ARCH to true (which is arm64 in my case). Then the following error happens:

    \/Users\/aaclarke\/dev\/flutter-wonderous-app\/build\/ios\/Debug-iphonesimulator\/google_maps_flutter_ios\/google_maps_flutter_ios.framework\/google_
                           maps_flutter_ios, building for iOS Simulator-arm64 but attempting to link with file built for iOS Simulator-x86_64"
    

    That dependency is incorrectly building for x64. @dcharkes Is that the package using native_assets?

    $ lipo -info build/ios/Debug-iphonesimulator/google_maps_flutter_ios/google_maps_flutter_ios.framework/google_maps_flutter_ios 
    Non-fat file: build/ios/Debug-iphonesimulator/google_maps_flutter_ios/google_maps_flutter_ios.framework/google_maps_flutter_ios is architecture: x86_64
    

    settings diff

    --- a/ios/Runner.xcodeproj/project.pbxproj
    +++ b/ios/Runner.xcodeproj/project.pbxproj
    @@ -451,15 +451,17 @@
                                    CODE_SIGN_IDENTITY = "Apple Development";
                                    CODE_SIGN_STYLE = Automatic;
                                    CURRENT_PROJECT_VERSION = 4;
                                    DEVELOPMENT_TEAM = S3TL5AY6Y3;
                                    ENABLE_BITCODE = NO;
    +                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 x86_x64";
                                    INFOPLIST_FILE = Runner/Info.plist;
                                    INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.travel";
                                    LD_RUNPATH_SEARCH_PATHS = (
                                            "$(inherited)",
                                            "@executable_path/Frameworks",
                                    );
    -                               PRODUCT_BUNDLE_IDENTIFIER = com.gskinner.flutter.wonders;
    +                               ONLY_ACTIVE_ARCH = YES;
    +                               PRODUCT_BUNDLE_IDENTIFIER = com.example.gskinner.flutter.wonders;
                                    PRODUCT_NAME = "$(TARGET_NAME)";
                                    PROVISIONING_PROFILE_SPECIFIER = "";
                                    SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
    @@ -590,15 +592,17 @@
                                    CODE_SIGN_IDENTITY = "Apple Development";
                                    CODE_SIGN_STYLE = Automatic;
                                    CURRENT_PROJECT_VERSION = 4;
                                    DEVELOPMENT_TEAM = S3TL5AY6Y3;
                                    ENABLE_BITCODE = NO;
    +                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 x86_64";
                                    INFOPLIST_FILE = Runner/Info.plist;
                                    INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.travel";
                                    LD_RUNPATH_SEARCH_PATHS = (
                                            "$(inherited)",
                                            "@executable_path/Frameworks",
                                    );
    -                               PRODUCT_BUNDLE_IDENTIFIER = com.gskinner.flutter.wonders;
    +                               ONLY_ACTIVE_ARCH = YES;
    +                               PRODUCT_BUNDLE_IDENTIFIER = com.example.gskinner.flutter.wonders;
                                    PRODUCT_NAME = "$(TARGET_NAME)";
                                    PROVISIONING_PROFILE_SPECIFIER = "";
                                    SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
    @@ -619,15 +623,17 @@
                                    CODE_SIGN_IDENTITY = "Apple Development";
                                    CODE_SIGN_STYLE = Automatic;
                                    CURRENT_PROJECT_VERSION = 4;
                                    DEVELOPMENT_TEAM = S3TL5AY6Y3;
                                    ENABLE_BITCODE = NO;
    +                               "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 x86_64";
                                    INFOPLIST_FILE = Runner/Info.plist;
                                    INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.travel";
                                    LD_RUNPATH_SEARCH_PATHS = (
                                            "$(inherited)",
                                            "@executable_path/Frameworks",
                                    );
    -                               PRODUCT_BUNDLE_IDENTIFIER = com.gskinner.flutter.wonders;
    +                               ONLY_ACTIVE_ARCH = YES;
    +                               PRODUCT_BUNDLE_IDENTIFIER = com.example.gskinner.flutter.wonders;
                                    PRODUCT_NAME = "$(TARGET_NAME)";
                                    PROVISIONING_PROFILE_SPECIFIER = "";
                                    SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
  8. dcharkes commented on Oct 21, 2023

    @dcharkes
    Contributor

    That dependency is incorrectly building for x64. @dcharkes Is that the package using native_assets?

    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 NativeAssets Target that was failing earlier is almost a no-op when the experiment is disabled. But for the sake of the incremental builds Targets need (1) a stable set of of dependencies and (2) always need to output the same files. So the NativeAssets target 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.)

  9. vashworth commented on Nov 17, 2023

    @vashworth
    Contributor

    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

  10. removed their assignment
    on Nov 17, 2023
  11. vashworth commented on Nov 17, 2023

    @vashworth
    Contributor

    So what I think is happening when using a local engine is that, ARCHS gets set in the config to arm64

    String arch;
    if (useMacOSConfig) {
    if (localEngineName.contains('_arm64')) {
    arch = 'arm64';
    } else {
    arch = 'x86_64';
    }
    } else {
    if (localEngineName.endsWith('_arm')) {
    throwToolExit('32-bit iOS local engine binaries are not supported.');
    } else if (localEngineName.contains('_arm64')) {
    arch = 'arm64';
    } else if (localEngineName.contains('_sim')) {
    arch = 'x86_64';
    } else {
    arch = 'arm64';
    }
    }
    xcodeBuildSettings.add('ARCHS=$arch');
    }

    However, EXCLUDED_ARCHS also includes arm64

    if (!useMacOSConfig) {
    // If any plugins or their dependencies do not support arm64 simulators
    // (to run natively without Rosetta translation on an ARM Mac),
    // the app will fail to build unless it also excludes arm64 simulators.
    String excludedSimulatorArchs = 'i386';
    if (!(await project.ios.pluginsSupportArmSimulator())) {
    excludedSimulatorArchs += ' arm64';
    }
    xcodeBuildSettings.add('EXCLUDED_ARCHS[sdk=iphonesimulator*]=$excludedSimulatorArchs');
    xcodeBuildSettings.add('EXCLUDED_ARCHS[sdk=iphoneos*]=armv7');
    }

    Which will result in resolved ARCHS during the build to be null/empty.

    We could maybe give better messaging about this, but I don't think ARCHS being empty is a bug.

  12. vashworth commented on Nov 17, 2023

    @vashworth
    Contributor

    @gaaclarke Did you try building engine for x86 simulator? I'm pretty sure arm simulators also accept x86 architecture

  13. added
    P3Issues that are less important to the Flutter project
    triaged-toolTriaged by Flutter Tool team
    on Jun 14, 2024
  14. matanlurey commented on Jul 11, 2025

    @matanlurey
    Contributor

    Is this still important?

  15. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 11, 2025
  16. gaaclarke commented on Jul 11, 2025

    @gaaclarke
    MemberAuthor

    Is this still important?

    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.

    Failed to build iOS app
    Error (Xcode): Target debug_unpack_ios failed: Exception: Binary /Users/aaclarke/dev/flutter-wonderous-app/build/ios/Debug-iphonesimulator/Flutter.framework/Flutter does
    not contain architectures "".
    
    [!] Flutter (Channel [user-branch], 3.33.0-1.0.pre.936, on macOS 15.5 24F74 darwin-arm64, locale en) [332ms]
        ! Flutter version 3.33.0-1.0.pre.936 on channel [user-branch] at /Users/aaclarke/dev/flutter
          Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
          If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
        ! Upstream repository unknown source is not a standard remote.
          Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
        • Framework revision 95d5dc37db (64 minutes ago), 2025-07-11 13:35:38 -0700
        • Engine revision 95d5dc37db
        • Dart version 3.9.0 (build 3.9.0-327.0.dev)
        • DevTools version 2.48.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets
        • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
    
  17. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 11, 2025
  18. gaaclarke commented on Jul 11, 2025

    @gaaclarke
    MemberAuthor

    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.

  19. added
    tool-still-validIssues that have been deemed still valid as part of the Flutter Tools issue cleanup initiative.
    on Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectengineflutter/engine related. See also e: labels.platform-iosiOS applications specificallyteam-toolOwned by Flutter Tool teamtoolAffects 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.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions