Skip to content

Flutter cannot build against ARM simulators (on ARM macOS host) #64502

Description

@jmagman

Targeting an ARM simulator fails:

[plugin_lint_mac] [STDOUT] stdout:     ld: building for iOS Simulator, but linking in dylib built for iOS, file '/var/folders/3y/l0z1x3693dl_8n0qybp4dqwh0000gn/T/CocoaPods-Lint-20200812-67637-y2vglb-test_plugin_objc/Pods/Flutter/Flutter.framework/Flutter' for architecture arm64
[plugin_lint_mac] [STDOUT] stdout:     clang: error: linker command failed with exit code 1 (use -v to see invocation

Flutter.framework has 2 arm iOS slices and 1 x86 simulator slice. There is no ARM simulator slice.

Also seen on an x86 host with iOS 14 simulators (so Xcode 12) when ONLY_ACTIVE_ARCH=NO (configuration=Release)

Blocked by #66926

Activity

  1. added
    engineflutter/engine related. See also e: labels.
    platform-iosiOS applications specifically
    on Aug 24, 2020
  2. jmagman commented on Aug 24, 2020

    @jmagman
    MemberAuthor

    Not sure if there's any dart work to do, since it already supports ARM simulators? This may just require building the Flutter.framework with a new architecture slice.

  3. jmagman commented on Aug 24, 2020

    @jmagman
    MemberAuthor

    See #2089, hopefully this is much less work than that was.

  4. jmagman commented on Aug 24, 2020

    @jmagman
    MemberAuthor
  5. jmagman commented on Aug 25, 2020

    @jmagman
    MemberAuthor

    Had to turn off linters when I upgrade Cirrus to Xcode 12 #63252
    Plugins CI is going to hit the same failure when they try to upgrade.

  6. alexmarkley commented on Sep 19, 2020

    @alexmarkley

    I'm encountering this problem as well. (Actually opened a duplicate issue, oops.)

    Any update on this? I'm happy to help if I can.

  7. alexmarkley commented on Sep 21, 2020

    @alexmarkley

    @jmagman In the context of some of the plumbing / tooling tasks that need to be done here, I would be happy to help, but I'm currently stuck on this issue: dart-lang/sdk#43488

    If you've got a line to the Dart team (or an idea for circumventing this blocker some other way) I would appreciate the help.

  8. Poweranimal commented on Sep 26, 2020

    @Poweranimal

    There's a workaround for this issue:
    Add config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' to the Podfile's post_install.
    E.g:

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ENABLE_BITCODE'] = 'NO'
          # Workaround for https://github.com/flutter/flutter/issues/64502
          config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'
        end
      end
    end
    

    I found the solution in another related issue here: flurry/flurry-ios-sdk#207 (comment)

  9. jmagman commented on Sep 28, 2020

    @jmagman
    MemberAuthor

    config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'

    That will let you build, but when you archive it won't build a fat binary with all the architectures your app supports. And it's only relevant if you're using plugins.

  10. jmagman commented on Sep 29, 2020

    @jmagman
    MemberAuthor

    Fixing this will also let us turn back on plugin linters, and will let the plugins repo update Cirrus to Xcode 12.
    #63252 (comment)

    // TODO(jmagman): Flutter cannot build against ARM simulators https://github.com/flutter/flutter/issues/64502
    canFail: true,

  11. jmagman commented on Sep 29, 2020

    @jmagman
    MemberAuthor

    Also, dependent on the builders using iOS 14 #65901.

  12. hyvenzhu commented on Oct 13, 2020

    @hyvenzhu
  13. 18 remaining items

  14. bhanuka96 commented on Jan 15, 2021

    @bhanuka96
  15. gourav6m17 commented on Jan 20, 2021

    @gourav6m17
  16. jmagman commented on Jan 20, 2021

    @jmagman
    Author
  17. jmagman commented on Mar 5, 2021

    @jmagman
    MemberAuthor

    However to work around it until that's done, you can explicitly exclude arm64 from your simulator archs. I tried to do this programmatically for all projects in #73458 but unfortunately versions of Xcode older than 12 do not handle the dance between EXCLUDED_ARCHS and VALID_ARCHS correctly.

    This has been fixed with #73828. On that PR you don't need to set EXCLUDED_ARCHS in your Podfile.

  18. jigarfumakiya commented on Apr 4, 2021

    @jigarfumakiya
  19. jmagman commented on Apr 5, 2021

    @jmagman
    Author
  20. added
    customer: crowdAffects or could affect many people, though not necessarily a specific customer.
    on Jun 2, 2021
  21. firatcetiner commented on Jun 28, 2021

    @firatcetiner
  22. jans-y commented on Jun 28, 2021

    @jans-y
  23. firatcetiner commented on Jun 28, 2021

    @firatcetiner
  24. jans-y commented on Jun 28, 2021

    @jans-y
  25. jmagman commented on Jun 28, 2021

    @jmagman
    Author
  26. github-actions commented on Jul 30, 2021

    @github-actions

    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 flutter doctor -v and a minimal reproduction of the issue.

  27. locked as resolved and limited conversation to collaborators on Jul 30, 2021
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

    P2Important issues not at the top of the work listcustomer: crowdAffects or could affect many people, though not necessarily a specific customer.dependency: dartDart team may need to help usengineflutter/engine related. See also e: labels.platform-host-armBuilding on an ARM-based platformplatform-iosiOS applications specifically

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions