Skip to content

Improve SwiftPM minimum platform mismatch diagnostics#182375

Merged
auto-submit[bot] merged 8 commits into
flutter:masterfrom
MohammedTarigg:fix-165420-swiftpm-deployment-target
Mar 4, 2026
Merged

Improve SwiftPM minimum platform mismatch diagnostics#182375
auto-submit[bot] merged 8 commits into
flutter:masterfrom
MohammedTarigg:fix-165420-swiftpm-deployment-target

Conversation

@MohammedTarigg

@MohammedTarigg MohammedTarigg commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Fixes #165420.

When using Swift Package Manager plugins, Xcode can fail with a minimum platform mismatch (a package requires a higher iOS/macOS version than the target supports).

This change detects that failure during iOS and macOS builds and prints actionable guidance about increasing the app's minimum deployment target, including which Flutter config-only commands to re-run.

Tests:

  • dart analyze (packages/flutter_tools)
  • dart test test/general.shard/ios/mac_test.dart
  • dart test test/commands.shard/hermetic/build_macos_test.dart

Local E2E repro:

  • Performed locally with throwaway fixtures (not checked in).

@MohammedTarigg MohammedTarigg requested a review from a team as a code owner February 13, 2026 15:47
@github-actions github-actions Bot added platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. a: desktop Running on desktop team-ios Owned by iOS platform team labels Feb 13, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request improves the diagnostics for Swift Package Manager minimum platform version mismatches on both iOS and macOS. It introduces logic to parse these specific errors from the build output and provides clear, actionable instructions to the user on how to resolve them. This is a valuable improvement to the developer experience. The changes are also well-tested. My only suggestion is to refactor the duplicated code between the iOS and macOS build files to improve maintainability.

Comment thread packages/flutter_tools/lib/src/macos/build_macos.dart Outdated
@vashworth vashworth self-requested a review February 18, 2026 02:31
Comment thread packages/flutter_tools/lib/src/ios/mac.dart
Comment thread packages/flutter_tools/lib/src/macos/build_macos.dart
@github-actions github-actions Bot removed the a: desktop Running on desktop label Feb 21, 2026
@MohammedTarigg

Copy link
Copy Markdown
Contributor Author

Thanks, that makes sense. I scoped this PR to iOS only and moved the minimum-platform detection to iOS stdout parsing with target-based handling.

@MohammedTarigg

Copy link
Copy Markdown
Contributor Author

@vashworth In parseVendoredFrameworksFromPbxproj, we currently only read direct children of PBXGroups named Frameworks and then pick PBXFileReferences.
If a pod/project has nested PBXGroups under Frameworks, we might miss those framework refs. Do you think this is worth handling now (recursive traversal), or should we keep current behavior unless we hit a concrete case?

Comment thread packages/flutter_tools/lib/src/ios/mac.dart Outdated
Comment thread packages/flutter_tools/lib/src/ios/mac.dart Outdated
Comment thread packages/flutter_tools/lib/src/ios/mac.dart Outdated
Comment thread packages/flutter_tools/lib/src/ios/mac.dart Outdated
Comment thread packages/flutter_tools/lib/src/ios/mac.dart Outdated
Comment thread packages/flutter_tools/lib/src/ios/mac.dart Outdated
Comment thread packages/flutter_tools/lib/src/ios/mac.dart
@vashworth

Copy link
Copy Markdown
Contributor

@vashworth In parseVendoredFrameworksFromPbxproj, we currently only read direct children of PBXGroups named Frameworks and then pick PBXFileReferences. If a pod/project has nested PBXGroups under Frameworks, we might miss those framework refs. Do you think this is worth handling now (recursive traversal), or should we keep current behavior unless we hit a concrete case?

I'm assuming you mean in reference to #180135. No, I don't think it's worth handling that case unless we have evidence to believe it's needed.

@MohammedTarigg MohammedTarigg force-pushed the fix-165420-swiftpm-deployment-target branch from 23250c4 to 65bfde5 Compare February 28, 2026 04:45
Comment thread packages/flutter_tools/lib/src/ios/mac.dart
Comment thread packages/flutter_tools/lib/src/ios/mac.dart
@MohammedTarigg MohammedTarigg force-pushed the fix-165420-swiftpm-deployment-target branch from 321a28c to f711287 Compare March 3, 2026 23:05

@vashworth vashworth 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.

@MohammedTarigg Thanks for your work on this!

@vashworth vashworth added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 4, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Mar 4, 2026
Merged via the queue into flutter:master with commit 6ec6dd1 Mar 4, 2026
145 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 4, 2026
@MohammedTarigg

Copy link
Copy Markdown
Contributor Author

@MohammedTarigg Thanks for your work on this!

@vashworth Thank you for the review and for guiding the scope. I really appreciate the help.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 5, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 5, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 5, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 5, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Mar 5, 2026
Roll Flutter from 46fb7210422d to d3dd7744e81f (33 revisions)

flutter/flutter@46fb721...d3dd774

2026-03-04 15619084+vashworth@users.noreply.github.com Show warning when plugins do not support SwiftPM (flutter/flutter#182506)
2026-03-04 15619084+vashworth@users.noreply.github.com Give guided message when project is not compatible with SwiftPM (flutter/flutter#182394)
2026-03-04 danny@tuppeny.com Pass --web-define through to web runner when using --machine mode (flutter/flutter#183228)
2026-03-04 104147021+MohammedTarigg@users.noreply.github.com Improve SwiftPM minimum platform mismatch diagnostics (flutter/flutter#182375)
2026-03-04 vegorov@google.com Use dart::bin::SetupDartIo to setup dart:io (flutter/flutter#176714)
2026-03-04 engine-flutter-autoroll@skia.org Roll Skia from 3197848b14ad to ada0b7628c79 (5 revisions) (flutter/flutter#183221)
2026-03-04 engine-flutter-autoroll@skia.org Roll Skia from fe9e9f22c531 to 3197848b14ad (15 revisions) (flutter/flutter#183198)
2026-03-04 34465683+rkishan516@users.noreply.github.com refactor: remove material in reorderable_list_test, scroll_notification_test, scroll_physics_test, shortcuts_test, sliver_floating_header_test, snapshot_widget_test (flutter/flutter#182698)
2026-03-04 34465683+rkishan516@users.noreply.github.com refactor: remove material in pop_scope_test, route_notification_message_test, two_dimensional_utils, two_dimensional_viewport_test (flutter/flutter#182699)
2026-03-04 737941+loic-sharma@users.noreply.github.com Add dev/benchmarks/README.md (flutter/flutter#182976)
2026-03-03 jason-simmons@users.noreply.github.com Roll RapidJSON to a branch based on the current upstream head (flutter/flutter#183048)
2026-03-03 flar@google.com [Impeller] Update comments to reflect new info about 2-pass rendering (flutter/flutter#183050)
2026-03-03 47866232+chunhtai@users.noreply.github.com Add vmservices for accessibilityEvaluation (flutter/flutter#182791)
2026-03-03 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 0dCDM2oORHwDf_pyb... to JJw5EJ87vLGqFVl4h... (flutter/flutter#183177)
2026-03-03 lukas.klingsbo@gmail.com Support mixed color spaces in `Color.lerp` (flutter/flutter#182934)
2026-03-03 36861262+QuncCccccc@users.noreply.github.com Add warning when there is a widget with color between `Material` and `ListTile` (flutter/flutter#181402)
2026-03-03 41930132+hellohuanlin@users.noreply.github.com [ios]uitest for admob banner in scrollable list gesture issue (flutter/flutter#183128)
2026-03-03 engine-flutter-autoroll@skia.org Roll Packages from faa4e22 to 9083bc9 (4 revisions) (flutter/flutter#183164)
2026-03-03 15619084+vashworth@users.noreply.github.com Build App and native asset frameworks for Add to App FlutterPluginRegistrant (flutter/flutter#183136)
2026-03-03 engine-flutter-autoroll@skia.org Roll Skia from f886711f180d to fe9e9f22c531 (4 revisions) (flutter/flutter#183155)
2026-03-03 engine-flutter-autoroll@skia.org Roll Dart SDK from e86dbe9aa742 to c597ef90d2dc (2 revisions) (flutter/flutter#183147)
2026-03-03 codefu@google.com fix: bump matcher (flutter/flutter#183167)
2026-03-02 58529443+srujzs@users.noreply.github.com Use isA to test for exceptions (flutter/flutter#183129)
2026-03-02 dpxhfxywang@163.com [two_dimensional_scrollables] Fix tableview janks when first row/column pinned (flutter/flutter#180563)
2026-03-02 victorsanniay@gmail.com Add await to callsites of BasicMessageChannel.send (flutter/flutter#182868)
2026-03-02 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183133)
2026-03-02 robert.ancell@canonical.com Improve FFI code for windowing (flutter/flutter#183098)
2026-03-02 kevinjchisholm@google.com [workflow] Update the changelog merge action to fetch the stable branch (flutter/flutter#183132)
2026-03-02 engine-flutter-autoroll@skia.org Roll Skia from e180358b7a7a to f886711f180d (2 revisions) (flutter/flutter#183130)
2026-03-02 jacksongardner@google.com Merge changelog from 3.41.3. (flutter/flutter#183131)
2026-03-02 50985133+SpiralMomentum@users.noreply.github.com Make TextDecoration final and unify maskValue across platforms (flutter/flutter#183070)
2026-03-02 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#182640)
2026-03-02 15619084+vashworth@users.noreply.github.com Enable SwiftPM by default on master and beta (flutter/flutter#182923)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
...
xxxOVALxxx pushed a commit to xxxOVALxxx/flutter that referenced this pull request Mar 10, 2026
Fixes flutter#165420.

When using Swift Package Manager plugins, Xcode can fail with a minimum
platform mismatch (a package requires a higher iOS/macOS version than
the target supports).

This change detects that failure during iOS and macOS builds and prints
actionable guidance about increasing the app's minimum deployment
target, including which Flutter config-only commands to re-run.

Tests:
- dart analyze (packages/flutter_tools)
- dart test test/general.shard/ios/mac_test.dart
- dart test test/commands.shard/hermetic/build_macos_test.dart

Local E2E repro:
- Performed locally with throwaway fixtures (not checked in).

---------

Co-authored-by: Victoria Ashworth <15619084+vashworth@users.noreply.github.com>
okorohelijah pushed a commit to okorohelijah/packages that referenced this pull request Mar 26, 2026
…r#11182)

Roll Flutter from 46fb7210422d to d3dd7744e81f (33 revisions)

flutter/flutter@46fb721...d3dd774

2026-03-04 15619084+vashworth@users.noreply.github.com Show warning when plugins do not support SwiftPM (flutter/flutter#182506)
2026-03-04 15619084+vashworth@users.noreply.github.com Give guided message when project is not compatible with SwiftPM (flutter/flutter#182394)
2026-03-04 danny@tuppeny.com Pass --web-define through to web runner when using --machine mode (flutter/flutter#183228)
2026-03-04 104147021+MohammedTarigg@users.noreply.github.com Improve SwiftPM minimum platform mismatch diagnostics (flutter/flutter#182375)
2026-03-04 vegorov@google.com Use dart::bin::SetupDartIo to setup dart:io (flutter/flutter#176714)
2026-03-04 engine-flutter-autoroll@skia.org Roll Skia from 3197848b14ad to ada0b7628c79 (5 revisions) (flutter/flutter#183221)
2026-03-04 engine-flutter-autoroll@skia.org Roll Skia from fe9e9f22c531 to 3197848b14ad (15 revisions) (flutter/flutter#183198)
2026-03-04 34465683+rkishan516@users.noreply.github.com refactor: remove material in reorderable_list_test, scroll_notification_test, scroll_physics_test, shortcuts_test, sliver_floating_header_test, snapshot_widget_test (flutter/flutter#182698)
2026-03-04 34465683+rkishan516@users.noreply.github.com refactor: remove material in pop_scope_test, route_notification_message_test, two_dimensional_utils, two_dimensional_viewport_test (flutter/flutter#182699)
2026-03-04 737941+loic-sharma@users.noreply.github.com Add dev/benchmarks/README.md (flutter/flutter#182976)
2026-03-03 jason-simmons@users.noreply.github.com Roll RapidJSON to a branch based on the current upstream head (flutter/flutter#183048)
2026-03-03 flar@google.com [Impeller] Update comments to reflect new info about 2-pass rendering (flutter/flutter#183050)
2026-03-03 47866232+chunhtai@users.noreply.github.com Add vmservices for accessibilityEvaluation (flutter/flutter#182791)
2026-03-03 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 0dCDM2oORHwDf_pyb... to JJw5EJ87vLGqFVl4h... (flutter/flutter#183177)
2026-03-03 lukas.klingsbo@gmail.com Support mixed color spaces in `Color.lerp` (flutter/flutter#182934)
2026-03-03 36861262+QuncCccccc@users.noreply.github.com Add warning when there is a widget with color between `Material` and `ListTile` (flutter/flutter#181402)
2026-03-03 41930132+hellohuanlin@users.noreply.github.com [ios]uitest for admob banner in scrollable list gesture issue (flutter/flutter#183128)
2026-03-03 engine-flutter-autoroll@skia.org Roll Packages from faa4e22 to 9083bc9 (4 revisions) (flutter/flutter#183164)
2026-03-03 15619084+vashworth@users.noreply.github.com Build App and native asset frameworks for Add to App FlutterPluginRegistrant (flutter/flutter#183136)
2026-03-03 engine-flutter-autoroll@skia.org Roll Skia from f886711f180d to fe9e9f22c531 (4 revisions) (flutter/flutter#183155)
2026-03-03 engine-flutter-autoroll@skia.org Roll Dart SDK from e86dbe9aa742 to c597ef90d2dc (2 revisions) (flutter/flutter#183147)
2026-03-03 codefu@google.com fix: bump matcher (flutter/flutter#183167)
2026-03-02 58529443+srujzs@users.noreply.github.com Use isA to test for exceptions (flutter/flutter#183129)
2026-03-02 dpxhfxywang@163.com [two_dimensional_scrollables] Fix tableview janks when first row/column pinned (flutter/flutter#180563)
2026-03-02 victorsanniay@gmail.com Add await to callsites of BasicMessageChannel.send (flutter/flutter#182868)
2026-03-02 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183133)
2026-03-02 robert.ancell@canonical.com Improve FFI code for windowing (flutter/flutter#183098)
2026-03-02 kevinjchisholm@google.com [workflow] Update the changelog merge action to fetch the stable branch (flutter/flutter#183132)
2026-03-02 engine-flutter-autoroll@skia.org Roll Skia from e180358b7a7a to f886711f180d (2 revisions) (flutter/flutter#183130)
2026-03-02 jacksongardner@google.com Merge changelog from 3.41.3. (flutter/flutter#183131)
2026-03-02 50985133+SpiralMomentum@users.noreply.github.com Make TextDecoration final and unify maskValue across platforms (flutter/flutter#183070)
2026-03-02 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#182640)
2026-03-02 15619084+vashworth@users.noreply.github.com Enable SwiftPM by default on master and beta (flutter/flutter#182923)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
...
mboetger pushed a commit to mboetger/flutter that referenced this pull request Mar 26, 2026
Fixes flutter#165420.

When using Swift Package Manager plugins, Xcode can fail with a minimum
platform mismatch (a package requires a higher iOS/macOS version than
the target supports).

This change detects that failure during iOS and macOS builds and prints
actionable guidance about increasing the app's minimum deployment
target, including which Flutter config-only commands to re-run.

Tests:
- dart analyze (packages/flutter_tools)
- dart test test/general.shard/ios/mac_test.dart
- dart test test/commands.shard/hermetic/build_macos_test.dart

Local E2E repro:
- Performed locally with throwaway fixtures (not checked in).

---------

Co-authored-by: Victoria Ashworth <15619084+vashworth@users.noreply.github.com>
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…r#11182)

Roll Flutter from 46fb7210422d to d3dd7744e81f (33 revisions)

flutter/flutter@46fb721...d3dd774

2026-03-04 15619084+vashworth@users.noreply.github.com Show warning when plugins do not support SwiftPM (flutter/flutter#182506)
2026-03-04 15619084+vashworth@users.noreply.github.com Give guided message when project is not compatible with SwiftPM (flutter/flutter#182394)
2026-03-04 danny@tuppeny.com Pass --web-define through to web runner when using --machine mode (flutter/flutter#183228)
2026-03-04 104147021+MohammedTarigg@users.noreply.github.com Improve SwiftPM minimum platform mismatch diagnostics (flutter/flutter#182375)
2026-03-04 vegorov@google.com Use dart::bin::SetupDartIo to setup dart:io (flutter/flutter#176714)
2026-03-04 engine-flutter-autoroll@skia.org Roll Skia from 3197848b14ad to ada0b7628c79 (5 revisions) (flutter/flutter#183221)
2026-03-04 engine-flutter-autoroll@skia.org Roll Skia from fe9e9f22c531 to 3197848b14ad (15 revisions) (flutter/flutter#183198)
2026-03-04 34465683+rkishan516@users.noreply.github.com refactor: remove material in reorderable_list_test, scroll_notification_test, scroll_physics_test, shortcuts_test, sliver_floating_header_test, snapshot_widget_test (flutter/flutter#182698)
2026-03-04 34465683+rkishan516@users.noreply.github.com refactor: remove material in pop_scope_test, route_notification_message_test, two_dimensional_utils, two_dimensional_viewport_test (flutter/flutter#182699)
2026-03-04 737941+loic-sharma@users.noreply.github.com Add dev/benchmarks/README.md (flutter/flutter#182976)
2026-03-03 jason-simmons@users.noreply.github.com Roll RapidJSON to a branch based on the current upstream head (flutter/flutter#183048)
2026-03-03 flar@google.com [Impeller] Update comments to reflect new info about 2-pass rendering (flutter/flutter#183050)
2026-03-03 47866232+chunhtai@users.noreply.github.com Add vmservices for accessibilityEvaluation (flutter/flutter#182791)
2026-03-03 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 0dCDM2oORHwDf_pyb... to JJw5EJ87vLGqFVl4h... (flutter/flutter#183177)
2026-03-03 lukas.klingsbo@gmail.com Support mixed color spaces in `Color.lerp` (flutter/flutter#182934)
2026-03-03 36861262+QuncCccccc@users.noreply.github.com Add warning when there is a widget with color between `Material` and `ListTile` (flutter/flutter#181402)
2026-03-03 41930132+hellohuanlin@users.noreply.github.com [ios]uitest for admob banner in scrollable list gesture issue (flutter/flutter#183128)
2026-03-03 engine-flutter-autoroll@skia.org Roll Packages from faa4e22 to 9083bc9 (4 revisions) (flutter/flutter#183164)
2026-03-03 15619084+vashworth@users.noreply.github.com Build App and native asset frameworks for Add to App FlutterPluginRegistrant (flutter/flutter#183136)
2026-03-03 engine-flutter-autoroll@skia.org Roll Skia from f886711f180d to fe9e9f22c531 (4 revisions) (flutter/flutter#183155)
2026-03-03 engine-flutter-autoroll@skia.org Roll Dart SDK from e86dbe9aa742 to c597ef90d2dc (2 revisions) (flutter/flutter#183147)
2026-03-03 codefu@google.com fix: bump matcher (flutter/flutter#183167)
2026-03-02 58529443+srujzs@users.noreply.github.com Use isA to test for exceptions (flutter/flutter#183129)
2026-03-02 dpxhfxywang@163.com [two_dimensional_scrollables] Fix tableview janks when first row/column pinned (flutter/flutter#180563)
2026-03-02 victorsanniay@gmail.com Add await to callsites of BasicMessageChannel.send (flutter/flutter#182868)
2026-03-02 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#183133)
2026-03-02 robert.ancell@canonical.com Improve FFI code for windowing (flutter/flutter#183098)
2026-03-02 kevinjchisholm@google.com [workflow] Update the changelog merge action to fetch the stable branch (flutter/flutter#183132)
2026-03-02 engine-flutter-autoroll@skia.org Roll Skia from e180358b7a7a to f886711f180d (2 revisions) (flutter/flutter#183130)
2026-03-02 jacksongardner@google.com Merge changelog from 3.41.3. (flutter/flutter#183131)
2026-03-02 50985133+SpiralMomentum@users.noreply.github.com Make TextDecoration final and unify maskValue across platforms (flutter/flutter#183070)
2026-03-02 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#182640)
2026-03-02 15619084+vashworth@users.noreply.github.com Enable SwiftPM by default on master and beta (flutter/flutter#182923)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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] Improve the error message if a plugin requires a higher deployment target version

3 participants