Skip to content

[flutter_tools] Fix arm64e incorrectly matching arm64 in EXCLUDED_ARCHS regex check #184056

Description

@trizin

Steps to reproduce

pluginsSupportArmSimulator() in xcode_project.dart uses the regex EXCLUDED_ARCHS.*arm64 to determine if any CocoaPods target excludes arm64 simulators. This regex incorrectly matches arm64e as a substring of arm64, causing Flutter to add arm64 to EXCLUDED_ARCHS in Generated.xcconfig even when no plugin actually excludes arm64.

Many common pods set EXCLUDED_ARCHS = arm64e armv7 armv7s in their build settings. Since arm64e contains arm64 the regex produces a false positive, and Generated.xcconfig ends up with:

EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64

This prevents building for arm64 simulators on Apple Silicon Macs, producing an error.

  1. Create a Flutter project with pods that set EXCLUDED_ARCHS = arm64e armv7 armv7s
  2. Run flutter run on an Apple Silicon Mac targeting an iOS Simulator
  3. Observe Generated.xcconfig contains EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64
  4. Build fails with architecture mismatch error

Expected results

Generated.xcconfig ends up with:

EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64e

Actual results

Generated.xcconfig ends up with:

EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386 arm64

Code sample

--

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

--

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions