Skip to content

Add Flutter as a Swift Package dependency - #178931

Merged
auto-submit[bot] merged 9 commits into
flutter:masterfrom
vashworth:swiftpm_local_flutter_dependency
Jan 13, 2026
Merged

auto-submit[bot] merged 9 commits into
flutter:masterfrom
vashworth:swiftpm_local_flutter_dependency

Conversation

@vashworth

@vashworth vashworth commented Nov 21, 2025 •

Copy link
Copy Markdown
Contributor

The main purpose of this PR is to add the Flutter framework as a Swift Package dependency. As such, Xcode will now handle the copying, thinning, and codesigning of the framework and therefore the Flutter Xcode Run Scripts shouldn't.

This will allow plugins to declare a dependency on the Flutter framework package and eliminate the need for the Pre-Action "prepare" script.

This PR does not technically make the Flutter framework a local package override, that will be added in a follow up PR: #179512

This change includes:

  • Generation of the FlutterFramework swift package (this will generate a Package.swift and symlink to the Flutter framework in the artifact cache)
    Screenshot 2025-12-04 at 4 54 43 PM
  • Adding the FlutterFramework as a dependency to the FlutterGeneratedPluginSwiftPackage (which the the Swift package the Xcode project has a dependency on)
    Screenshot 2025-12-04 at 4 55 13 PM

Change to Flutter Run Scripts

Flutter currently has 3 Xcode Run Scripts:

  • prepare (happens in a scheme pre-action)
    • [PREVIOUS] Via flutter assemble - copies the Flutter framework from engine build cache to BUILT_PRODUCTS_DIR
    • [NEW] Same as previous except skips codesigning. This is still included to accommodate plugins that don't have a dependency declared on the Flutter framework.
  • build (happens in first Run Script in the Xcode build phases that happens before compiling)
    • [PREVIOUS] Via flutter assemble - copies, thins, and codesigns Flutter framework into BUILT_PRODUCTS_DIR
    • [NEW] Is skipped, Xcode now does this
  • embed_and_thin (happens in second Run Script in the Xcode build phases after compiling, linking, and embedding)
    • [PREVIOUS] Copies Flutter framework from BUILT_PRODUCTS_DIR to TARGET_BUILD_DIR
    • [NEW]
      • Validates Flutter framework in BUILT_PRODUCTS_DIR & TARGET_BUILD_DIR (which would have been put there by Xcode via SwiftPM) matches the Flutter framework in the engine cache.
      • If it matches, do not copy. Xcode now does this.
      • If it doesn't:
        • Call flutter assemble to copy the correct Flutter framework into BUILT_PRODUCTS_DIR
        • Then copy from BUILT_PRODUCTS_DIR to TARGET_BUILD_DIR.

Fixes #166489.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. a: desktop Running on desktop f: integration_test The flutter/packages/integration_test plugin team-ios Owned by iOS platform team labels Nov 21, 2025
Comment on lines +414 to +418
final String? sdkRoot = environment['SDKROOT']?.toLowerCase();
if (sdkRoot == null || !sdkRoot.contains('iphone')) {
return null;
}
final bool simulatorSDK = sdkRoot.contains('simulator');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mimicking:

EnvironmentType? environmentTypeFromSdkroot(String sdkroot, FileSystem fileSystem) {
// iPhoneSimulator.sdk or iPhoneOS.sdk
final String sdkName = fileSystem.path.basename(sdkroot).toLowerCase();
if (sdkName.contains('iphone')) {
return sdkName.contains('simulator') ? EnvironmentType.simulator : EnvironmentType.physical;
}
assert(false);
return null;
}

Comment on lines +419 to +427
for (final FileSystemEntity entity in xcframework.listSync()) {
final String platformBaseName = Uri.parse(entity.path).pathSegments.last;
if (entity is Directory && platformBaseName.startsWith('ios-')) {
final bool isSimulatorDirectory = platformBaseName.endsWith('-simulator');
if (simulatorSDK == isSimulatorDirectory) {
return File('${entity.path}/${platform.infoPlistPath}');
}
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mimicking:

for (final Directory platformDirectory
in xcframeworkDirectory.listSync().whereType<Directory>()) {
if (!platformDirectory.basename.startsWith('ios-')) {
continue;
}
// ios-x86_64-simulator, ios-arm64_x86_64-simulator, or ios-arm64.
final bool simulatorDirectory = platformDirectory.basename.endsWith('-simulator');
if ((environmentType == EnvironmentType.simulator && simulatorDirectory) ||
(environmentType == EnvironmentType.physical && !simulatorDirectory)) {
return platformDirectory;
}
}
throwToolExit('No iOS frameworks found in ${xcframeworkDirectory.path}');

Comment on lines +429 to +434
for (final FileSystemEntity entity in xcframework.listSync()) {
final String platformBaseName = Uri.parse(entity.path).pathSegments.last;
if (entity is Directory && platformBaseName.startsWith('macos-')) {
return File('${entity.path}/${platform.infoPlistPath}');
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mimicking:

final Directory? platformDirectory = xcframeworkDirectory
.listSync()
.whereType<Directory>()
.where((Directory platformDirectory) => platformDirectory.basename.startsWith('macos-'))
.firstOrNull;
if (platformDirectory == null) {
throwToolExit('No macOS frameworks found in ${xcframeworkDirectory.path}');
}

@vashworth
vashworth marked this pull request as ready for review December 5, 2025 19:31
@vashworth
vashworth requested a review from a team as a code owner December 5, 2025 19:31

@stuartmorgan-g stuartmorgan-g left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, but LGTM. The large caveat is that I have limited familiarity with this part of the code, so am unlikely to notice subtle implementation mistakes, but the structure makes sense to me and matches my understanding of the design doc, and the tests look thorough.

Comment thread packages/flutter_tools/bin/xcode_backend.dart Outdated
Comment thread packages/flutter_tools/bin/xcode_backend.dart
Comment thread packages/flutter_tools/lib/src/build_info.dart Outdated
Comment thread packages/flutter_tools/test/general.shard/xcode_backend_test.dart Outdated
Comment thread packages/flutter_tools/test/general.shard/xcode_backend_test.dart Outdated
Comment thread packages/flutter_tools/test/general.shard/xcode_backend_test.dart Outdated
@jmagman

jmagman commented Jan 2, 2026

Copy link
Copy Markdown
Member

@vashworth is this ready to merge?

@vashworth vashworth added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 13, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jan 13, 2026
Merged via the queue into flutter:master with commit d316469 Jan 13, 2026
142 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 13, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 14, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 19, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 20, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 21, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 22, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 23, 2026
auto-submit Bot pushed a commit that referenced this pull request Jan 28, 2026
This PR creates a FlutterFramework swift package with no real content. This is a placeholder so that plugins may add a dependency on the FlutterFramework in their Package.swift before #178931 lands in stable. See go/swiftpm-flutter-release.

Impacted Users: Flutter iOS with SwiftPM feature flag enabled

Impact Description: Allows plugins to add a dependency on the FlutterFramework in their Package.swift.

Workaround: See Problem 2 alternatives in [go/swiftpm-flutter-release](http://goto.google.com/swiftpm-flutter-release)

Risk: This PR by itself is low risk. It just generates a couple files in an ephemeral directory. It only is actually used if a plugin adds a dependency on it in it's Package.swift. If a plugin does this, it's still low risk since it's basically just an empty Swift package. It's also behind a feature flag (`flutter config --enable-swift-package-manager`), which can be disabled.

Test Coverage: Yes

Validation Steps: 
 - `flutter config --enable-swift-package-manager`
 - `flutter create my_plugin && cd my_plugin/example`
 - Add `FlutterFramework` to Package.swift (see [example](https://github.com/flutter/flutter/blob/master/packages/integration_test/ios/integration_test/Package.swift#L15-L21))
 - `flutter build ios`

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
github-merge-queue Bot pushed a commit that referenced this pull request Feb 3, 2026
This PR keeps the FlutterFramework swift package introduced in
#178931, but removes the
Flutter.xcframework as a dependency, essentially making it empty. As
such, it also restores the build scripts to copy and codesign the
framework instead of letting Xcode do it. This is a temporary solution
while we decide a long-term strategy:
[go/flutter-ios-privacy-impacting-sdks-codesign-requirement](http://goto.google.com/flutter-ios-privacy-impacting-sdks-codesign-requirement)

Fixes #181630.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Feb 6, 2026
This PR keeps the FlutterFramework swift package introduced in
flutter#178931, but removes the
Flutter.xcframework as a dependency, essentially making it empty. As
such, it also restores the build scripts to copy and codesign the
framework instead of letting Xcode do it. This is a temporary solution
while we decide a long-term strategy:
[go/flutter-ios-privacy-impacting-sdks-codesign-requirement](http://goto.google.com/flutter-ios-privacy-impacting-sdks-codesign-requirement)

Fixes flutter#181630.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
This PR keeps the FlutterFramework swift package introduced in
flutter#178931, but removes the
Flutter.xcframework as a dependency, essentially making it empty. As
such, it also restores the build scripts to copy and codesign the
framework instead of letting Xcode do it. This is a temporary solution
while we decide a long-term strategy:
[go/flutter-ios-privacy-impacting-sdks-codesign-requirement](http://goto.google.com/flutter-ios-privacy-impacting-sdks-codesign-requirement)

Fixes flutter#181630.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
This PR keeps the FlutterFramework swift package introduced in
flutter#178931, but removes the
Flutter.xcframework as a dependency, essentially making it empty. As
such, it also restores the build scripts to copy and codesign the
framework instead of letting Xcode do it. This is a temporary solution
while we decide a long-term strategy:
[go/flutter-ios-privacy-impacting-sdks-codesign-requirement](http://goto.google.com/flutter-ios-privacy-impacting-sdks-codesign-requirement)

Fixes flutter#181630.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Xbectordash pushed a commit to Xbectordash/abhi_flutter_fork that referenced this pull request May 13, 2026
This PR creates a FlutterFramework swift package with no real content. This is a placeholder so that plugins may add a dependency on the FlutterFramework in their Package.swift before flutter#178931 lands in stable. See go/swiftpm-flutter-release.

Impacted Users: Flutter iOS with SwiftPM feature flag enabled

Impact Description: Allows plugins to add a dependency on the FlutterFramework in their Package.swift.

Workaround: See Problem 2 alternatives in [go/swiftpm-flutter-release](http://goto.google.com/swiftpm-flutter-release)

Risk: This PR by itself is low risk. It just generates a couple files in an ephemeral directory. It only is actually used if a plugin adds a dependency on it in it's Package.swift. If a plugin does this, it's still low risk since it's basically just an empty Swift package. It's also behind a feature flag (`flutter config --enable-swift-package-manager`), which can be disabled.

Test Coverage: Yes

Validation Steps:
 - `flutter config --enable-swift-package-manager`
 - `flutter create my_plugin && cd my_plugin/example`
 - Add `FlutterFramework` to Package.swift (see [example](https://github.com/flutter/flutter/blob/master/packages/integration_test/ios/integration_test/Package.swift#L15-L21))
 - `flutter build ios`

**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
Nakiha pushed a commit to Nakiha/VoidPlayer-Flutter that referenced this pull request Sep 28, 2026
This PR keeps the FlutterFramework swift package introduced in
flutter/flutter#178931, but removes the
Flutter.xcframework as a dependency, essentially making it empty. As
such, it also restores the build scripts to copy and codesign the
framework instead of letting Xcode do it. This is a temporary solution
while we decide a long-term strategy:
[go/flutter-ios-privacy-impacting-sdks-codesign-requirement](http://goto.google.com/flutter-ios-privacy-impacting-sdks-codesign-requirement)

Fixes flutter/flutter#181630.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

**Note**: The Flutter team is currently trialing the use of [Gemini Code
Assist for
GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code).
Comments from the `gemini-code-assist` bot should not be taken as
authoritative feedback from the Flutter team. If you find its comments
useful you can update your code accordingly, but if you are unsure or
disagree with the feedback, please feel free to wait for a Flutter team
member's review for guidance on which automated comments should be
addressed.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
ahmednfwela added a commit to Bdaya-Dev/oidc that referenced this pull request Oct 4, 2026
Flutter does not require a plugin's Package.swift to depend on the
FlutterFramework SwiftPM wrapper: flutter_tools only emits a warning
(validatePluginSupportsSwiftPackageManager in
darwin_dependency_management.dart) when it's missing, and
xcode_backend.dart keeps the legacy embed/codesign run-script path
("to accommodate plugins that don't have a dependency declared on the
Flutter framework") for exactly this case. oidc_ios 0.8.0+3 itself
shipped with an empty Package.swift dependencies list and compiled
`import Flutter` fine, proving the dependency was never load-bearing.

The FlutterFramework mechanism also doesn't exist before Flutter
3.44.0 (flutter/flutter#178931), so the floor this previously raised
to Flutter >=3.41.0 / Dart ^3.11.0 was both unnecessary and wrong -
and it broke the 0.8.x release branch's CI, which still pins Flutter
3.35.4 in .github/actions/flutter_base.

Drop the FlutterFramework dependency, restore the original SDK floor
(sdk >=3.5.0 <4.0.0, flutter >=3.22.0) from the 0.8.0+3 tag, and
revert the test file reformat that the floor bump had required. The
Package.swift relocation, Sources/ layout, and podspec path fix from
the original backport are kept, since those are the actual fix for
Flutter not finding the plugin's SwiftPM manifest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0126i8ymDVXbifp6LrbCiyQL
ahmednfwela added a commit to Bdaya-Dev/oidc that referenced this pull request Oct 4, 2026
Flutter does not require a plugin's Package.swift to depend on the
FlutterFramework SwiftPM wrapper: flutter_tools only emits a warning
(validatePluginSupportsSwiftPackageManager in
darwin_dependency_management.dart) when it's missing, and
xcode_backend.dart keeps the legacy embed/codesign run-script path
("to accommodate plugins that don't have a dependency declared on the
Flutter framework") for exactly this case. oidc_macos 0.8.0+3 itself
shipped with an empty Package.swift dependencies list and compiled
`import FlutterMacOS` fine, proving the dependency was never
load-bearing.

The FlutterFramework mechanism also doesn't exist before Flutter
3.44.0 (flutter/flutter#178931), so the floor this previously raised
to Flutter >=3.41.0 / Dart ^3.11.0 was both unnecessary and wrong -
and it broke the 0.8.x release branch's CI, which still pins Flutter
3.35.4 in .github/actions/flutter_base.

Drop the FlutterFramework dependency, restore the original SDK floor
(sdk >=3.5.0 <4.0.0, flutter >=3.22.0) from the 0.8.0+3 tag, and
revert the test file reformat that the floor bump had required. The
Package.swift relocation, Sources/ layout, and podspec path fix from
the original backport are kept, since those are the actual fix for
Flutter not finding the plugin's SwiftPM manifest.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_0126i8ymDVXbifp6LrbCiyQL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop a: tests "flutter test", flutter_test, or one of our tests f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SwiftPM] Flutter generates a local Flutter framework swift package

3 participants