Skip to content

Distribute engine as Flutter.xcframework #60109

@jmagman

Description

@jmagman

Xcode 11 (minimum required version in Flutter) introduced the .xcframework for distributing frameworks for multiple platforms and architectures. At build time, the correct version of the framework is linked on. An XCFramework is already being used for add-to-app with the flutter build ios-framework --xcframework flag.

As Apple is increasing the number of architectures available for each platform (Catalyst as iOS apps on macOS, arm64 macOS) having one bundle containing all available architectures would reduce logic for the tool. Particularly, no more re-copying the framework into the project when platforms architecture changes (still needs to be done per build mode), and no more lipo to remove unused architectures.

As an additional bonus, Flutter.xcframework can be distributed as a Swift Package as of Xcode 12. See #33850 (comment)

With #51453 iOS linking and embedding logic has moved into the tool, so there won't be migration needed for existing projects.

  • Update LUCI recipes to create a Flutter.xcframework instead of a Flutter.framework. Still need them separated for Debug, Profile, and Release.
  • Flutter.podspec would need to change to s.vendored_frameworks = 'Flutter.xcframework'
  • Minimum required CocoaPods version in the tool would become 1.9 to handle that vendored xcframework. Update CocoaPods minimum version to 1.9 #71170

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterengineflutter/engine related. See also e: labels.t: xcode"xcodebuild" on iOS and general Xcode project managementtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions