Skip to content

[SwiftPM Add2App] Add flag to allow Flutter framework to use a remote url instead of copying #81867

Open

Description

@jmagman

Add flutter build ios-framework --swift-package flag to generate a Swift package manifest for the Flutter.xcframework to be consumed by the host app without the Flutter SDK installed, as an alternative to CocoaPods.

Would look something like:

// swift-tools-version:5.3

import PackageDescription

let package = Package(
  name: "Flutter",
  platforms: [
    .iOS(.v9)
  ],
  products: [
    .library(
      name: "Flutter",
      targets: ["Flutter"]),
  ],
  targets: [
    .binaryTarget(
      name: "Flutter",
      url: "https://storage.googleapis.com/flutter_infra_release/flutter/5d8bf811b3072390933d69f3e289a4bb673636c4/ios-release/artifacts.zip",
      checksum: "746f02ffe75c030e98d028be45917da0bd04327eef6207e48e008ea5933861e9"
  ]
)

This requires that the Swift checksum be calculated for the iOS engine artifacts zip containing the XCFramework
https://developer.apple.com/documentation/swift_packages/distributing_binary_frameworks_as_swift_packages#3578966

Note swift package compute-checksum annoyingly requires a Package.swift file in the working directory, even if it's empty.

$ touch Package.swift
$ swift package compute-checksum artifacts.zip
746f02ffe75c030e98d028be45917da0bd04327eef6207e48e008ea5933861e9

This could be calculated as part of downloading the artifacts locally on the developer's machine before the zip is deleted, or it could be done on the engine publishing side.

Activity

  1. added
    platform-iosiOS applications specifically
    toolAffects the "flutter" command-line tool. See also t: labels.
    t: xcode"xcodebuild" on iOS and general Xcode project management
    a: existing-appsIntegration with existing apps via the add-to-app flow
    on May 4, 2021
  2. changed the title [-]Allow add-to-app frameworks to be consumed as Swift Packages[/-] [+]Allow add-to-app Flutter.xcframework to be consumed as a Swift Package[/+] on May 4, 2021
  3. added
    P2Important issues not at the top of the work list
    on Jul 25, 2023
  4. added theissue type on Apr 2, 2025
  5. changed the title [-]Allow add-to-app Flutter.xcframework to be consumed as a Swift Package[/-] [+][SwiftPM Add2App] Add flag to allow Flutter framework to use a remote url instead of copying[/+] on Jan 20, 2026
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 lista: existing-appsIntegration with existing apps via the add-to-app flowc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: castawayplatform-iosiOS applications specificallyt: xcode"xcodebuild" on iOS and general Xcode project managementteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions