Skip to content

Show warning when plugins do not support SwiftPM#182506

Merged
auto-submit[bot] merged 3 commits intoflutter:masterfrom
vashworth:swiftpm_plugin_unsupported
Mar 4, 2026
Merged

Show warning when plugins do not support SwiftPM#182506
auto-submit[bot] merged 3 commits intoflutter:masterfrom
vashworth:swiftpm_plugin_unsupported

Conversation

@vashworth
Copy link
Contributor

@vashworth vashworth commented Feb 17, 2026

Provides a warning with a list of plugins that do not support SwiftPM. This is displayed to the app developer. It then recommends they reach out to the plugin maintainers to adopt SwiftPM.

Example:

The following plugins do not support Swift Package Manager for ios:
  - sqflite_sqlcipher
  - sign_in_with_apple
  - permission_handler_apple
  - flutter_secure_storage
  - flutter_inappwebview_ios
  - flutter_facebook_auth
  - flutter_contacts
  - flutter_config
  - fast_contacts
This will not be supported in a future version of Flutter. Please contact the plugin maintainers to request Swift Package Manager
adoption.

Fixes #152038.

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 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 17, 2026
@vashworth vashworth marked this pull request as ready for review February 18, 2026 17:56
@vashworth vashworth requested a review from a team as a code owner February 18, 2026 17:56
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 introduces a helpful warning for developers using Flutter plugins that do not support Swift Package Manager. The change correctly identifies CocoaPods-only plugins and informs the user with a clear, actionable message. The accompanying test updates ensure this new warning is behaving as expected. My review includes a few suggestions to make the tests more specific and robust.

Comment on lines +471 to +474
expect(
testLogger.warningText,
contains('The following plugins do not support Swift Package Manager'),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

To make this test more robust, it would be good to also assert that the name of the problematic plugin (cocoapod_plugin_1) is present in the warning message. This ensures we're not just getting a generic warning, but one that correctly identifies the plugin.

Suggested change
expect(
testLogger.warningText,
contains('The following plugins do not support Swift Package Manager'),
);
expect(
testLogger.warningText,
allOf(
contains('The following plugins do not support Swift Package Manager'),
contains('cocoapod_plugin_1'),
),
);

Comment on lines +541 to +544
expect(
testLogger.warningText,
contains('The following plugins do not support Swift Package Manager'),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Similar to my other comment, let's make this assertion more specific by also checking for the plugin name in the warning text. This will make the test more reliable.

Suggested change
expect(
testLogger.warningText,
contains('The following plugins do not support Swift Package Manager'),
);
expect(
testLogger.warningText,
allOf(
contains('The following plugins do not support Swift Package Manager'),
contains('cocoapod_plugin_1'),
),
);

Comment on lines +598 to +601
expect(
testLogger.warningText,
contains('The following plugins do not support Swift Package Manager'),
);
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency and to make the test stronger, let's also verify here that the specific plugin name appears in the warning message.

Suggested change
expect(
testLogger.warningText,
contains('The following plugins do not support Swift Package Manager'),
);
expect(
testLogger.warningText,
allOf(
contains('The following plugins do not support Swift Package Manager'),
contains('cocoapod_plugin_1'),
),
);

}
}

if (hostPlatformIsMacOS && cocoapodOnlyPlugins.isNotEmpty) {
Copy link
Contributor

Choose a reason for hiding this comment

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

curious will hostPlatformIsMacOS ever be false? I thought this code only runs on macOS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Technically this code does run on other hosts. For example, a Flutter user can still create an app that supports iOS on a Windows computer even though they can't run it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting!

Copy link
Contributor

Choose a reason for hiding this comment

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

just to check i understand - this warning is printed when doing flutter create?

_logger.printWarning(
'The following plugins do not support Swift Package Manager for ${platform.name}:\n'
' - ${cocoapodOnlyPlugins.join('\n - ')}\n'
'This will not be supported in a future version of Flutter. Please contact the plugin '
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: avoid double negation: "This (plugins not supporting SwiftPM) will not be supported".

Try something like "Future version of Flutter will require SwiftPM. Please contact..."

Copy link
Contributor

@okorohelijah okorohelijah left a comment

Choose a reason for hiding this comment

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

lgtm

@vashworth vashworth requested a review from a team as a code owner March 3, 2026 16:31
@github-actions github-actions bot added team-macos Owned by the macOS platform team platform-macos labels Mar 3, 2026
@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 d3dd774 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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 4, 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
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 [email protected] Show warning when plugins do not support SwiftPM (flutter/flutter#182506)
2026-03-04 [email protected] Give guided message when project is not compatible with SwiftPM (flutter/flutter#182394)
2026-03-04 [email protected] Pass --web-define through to web runner when using --machine mode (flutter/flutter#183228)
2026-03-04 [email protected] Improve SwiftPM minimum platform mismatch diagnostics (flutter/flutter#182375)
2026-03-04 [email protected] Use dart::bin::SetupDartIo to setup dart:io (flutter/flutter#176714)
2026-03-04 [email protected] Roll Skia from 3197848b14ad to ada0b7628c79 (5 revisions) (flutter/flutter#183221)
2026-03-04 [email protected] Roll Skia from fe9e9f22c531 to 3197848b14ad (15 revisions) (flutter/flutter#183198)
2026-03-04 [email protected] 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 [email protected] refactor: remove material in pop_scope_test, route_notification_message_test, two_dimensional_utils, two_dimensional_viewport_test (flutter/flutter#182699)
2026-03-04 [email protected] Add dev/benchmarks/README.md (flutter/flutter#182976)
2026-03-03 [email protected] Roll RapidJSON to a branch based on the current upstream head (flutter/flutter#183048)
2026-03-03 [email protected] [Impeller] Update comments to reflect new info about 2-pass rendering (flutter/flutter#183050)
2026-03-03 [email protected] Add vmservices for accessibilityEvaluation (flutter/flutter#182791)
2026-03-03 [email protected] Roll Fuchsia Linux SDK from 0dCDM2oORHwDf_pyb... to JJw5EJ87vLGqFVl4h... (flutter/flutter#183177)
2026-03-03 [email protected] Support mixed color spaces in `Color.lerp` (flutter/flutter#182934)
2026-03-03 [email protected] Add warning when there is a widget with color between `Material` and `ListTile` (flutter/flutter#181402)
2026-03-03 [email protected] [ios]uitest for admob banner in scrollable list gesture issue (flutter/flutter#183128)
2026-03-03 [email protected] Roll Packages from faa4e22 to 9083bc9 (4 revisions) (flutter/flutter#183164)
2026-03-03 [email protected] Build App and native asset frameworks for Add to App FlutterPluginRegistrant (flutter/flutter#183136)
2026-03-03 [email protected] Roll Skia from f886711f180d to fe9e9f22c531 (4 revisions) (flutter/flutter#183155)
2026-03-03 [email protected] Roll Dart SDK from e86dbe9aa742 to c597ef90d2dc (2 revisions) (flutter/flutter#183147)
2026-03-03 [email protected] fix: bump matcher (flutter/flutter#183167)
2026-03-02 [email protected] Use isA to test for exceptions (flutter/flutter#183129)
2026-03-02 [email protected] [two_dimensional_scrollables] Fix tableview janks when first row/column pinned (flutter/flutter#180563)
2026-03-02 [email protected] Add await to callsites of BasicMessageChannel.send (flutter/flutter#182868)
2026-03-02 [email protected] Roll pub packages (flutter/flutter#183133)
2026-03-02 [email protected] Improve FFI code for windowing (flutter/flutter#183098)
2026-03-02 [email protected] [workflow] Update the changelog merge action to fetch the stable branch (flutter/flutter#183132)
2026-03-02 [email protected] Roll Skia from e180358b7a7a to f886711f180d (2 revisions) (flutter/flutter#183130)
2026-03-02 [email protected] Merge changelog from 3.41.3. (flutter/flutter#183131)
2026-03-02 [email protected] Make TextDecoration final and unify maskValue across platforms (flutter/flutter#183070)
2026-03-02 [email protected] Roll pub packages (flutter/flutter#182640)
2026-03-02 [email protected] 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 [email protected],[email protected] 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
Provides a warning with a list of plugins that do not support SwiftPM.
This is displayed to the app developer. It then recommends they reach
out to the plugin maintainers to adopt SwiftPM.

Example:
```
The following plugins do not support Swift Package Manager for ios:
  - sqflite_sqlcipher
  - sign_in_with_apple
  - permission_handler_apple
  - flutter_secure_storage
  - flutter_inappwebview_ios
  - flutter_facebook_auth
  - flutter_contacts
  - flutter_config
  - fast_contacts
This will not be supported in a future version of Flutter. Please contact the plugin maintainers to request Swift Package Manager
adoption.
```

Fixes flutter#152038.

## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop platform-macos team-ios Owned by iOS platform team team-macos Owned by the macOS 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.

[tool] Notify app developers of plugins that are incompatible with Swift Package Manager

3 participants