Skip to content

[various] Remove CocoaPods from examples#11237

Merged
auto-submit[bot] merged 3 commits intoflutter:mainfrom
stuartmorgan-g:pod-deintegration
Mar 14, 2026
Merged

[various] Remove CocoaPods from examples#11237
auto-submit[bot] merged 3 commits intoflutter:mainfrom
stuartmorgan-g:pod-deintegration

Conversation

@stuartmorgan-g
Copy link
Collaborator

@stuartmorgan-g stuartmorgan-g commented Mar 12, 2026

For almost all projects in the repository, this does the steps recommended by the warning when building with Swift Package Manager enabled (for both ios/ and macos/, wherever they are present):

  • Runs pod deintigrate
  • Deletes Podfile
  • Removes the CocoaPod xcconfig references in the Flutter Debug and Release xcconfigs.

When running without Swift Package Manager enabled, flutter will automatically re-add this integration, so this won't break anyone running these examples on stable. However, we are no longer expecting this to be a common workflow (CI no longer builds these apps in non-SwiftPM mode, and regular flutter/package contributors are likely to be on master where SwiftPM is on by default now), so it's no longer useful to have the integration checked in.

The only packages that have not had Pod integration removed are:

  • google_maps_flutter_ios because it doesn't (and can't) support Swift Package Manager.
  • google_maps_flutter because it depends on google_maps_flutter_ios as the default implementation.

This also removes the precache steps from ios_build_all_packages and macos_build_all_packages. Because that step runs per package, it was doing a lot of caching of native code that was package-scoped, and thus wouldn't be used by the all-packages app, and in the current configuration isn't even the right kind of dependency (it will fetch SwiftPM deps, but the all-packages app uses CocoaPods still to cover that mode).

Follow-up to flutter/flutter#172427

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2

For almost all projects in the repository, this does the steps
recommended by the warning when building with Swift Package Manager
enabled (for both ios/ and macos/, wherever they are present):
- Runs `pod deintigrate`
- Deletes `Podfile`
- Removes the CocoaPod xcconfig references in the Flutter Debug and
  Release xcconfigs.

When running without Swift Package Manager enabled, `flutter` will
automatically re-add this integration, so this won't break anyone
running these examples on `stable`. However, we are no longer expecting
this to be a common workflow (CI no longer builds these apps in
non-SwiftPM mode, and regular flutter/package contributors are likely to
be on `master` where SwiftPM is on by default now), so it's no longer
useful to have the integration checked in.

The only packages that have not had Pod integration removed are:
- `google_maps_flutter_ios` because it doesn't (and can't) support Swift
  Package Manager.
- `google_maps_flutter` because it depends on `google_maps_flutter_ios`
  as the default implementation.

Follow-up to flutter/flutter#172427
Copy link

@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 removes CocoaPods integration from numerous example applications across various packages. The changes include the deletion of Podfiles, removal of CocoaPods-related includes from .xcconfig files, and updates to Xcode project files (.pbxproj) to eliminate all references to CocoaPods build phases, frameworks, and configurations. In some cases, Swift Package Manager dependencies are introduced through new Package.resolved files, reflecting a migration in dependency management.

@stuartmorgan-g stuartmorgan-g added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 13, 2026
@stuartmorgan-g stuartmorgan-g added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App and removed CICD Run CI/CD labels Mar 13, 2026
@auto-submit auto-submit bot merged commit 409793b into flutter:main Mar 14, 2026
81 checks passed
@stuartmorgan-g
Copy link
Collaborator Author

When running without Swift Package Manager enabled, flutter will automatically re-add this integration, so this won't break anyone running these examples on stable.

This turned out not to be entirely true. I didn't think about the fact that the Podfile in the flutter template references the RunnerTest that's in the template Xcode project (as part of our effort to make adding native unit tests to plugins easy), but we've removed RunnerTest from the example apps where it doesn't make sense, so the auto-created Podfile won't actually build without minor manual intervention (removing the RunnerTest lines).

I think that's fine since we don't expect this to be a common use case, and the fix is easy to apply locally if someone does need to build on stable, so unless it becomes a significant issue I don't think we should revert. It did accidentally break the tree though, which I'm fixing in the repo tooling.

auto-submit bot pushed a commit that referenced this pull request Mar 16, 2026
Currently the iOS/macOS part of `fetch-deps` uses whatever the default Swift Package Manager setting is, even though the `build-examples` command is always using Swift Package Manager. That means that it's caching a bunch of things we don't need. This PR adds a `--swift-package-manager` flag to `fetch-deps`, and passes the same value we are using for `build-examples`.

This fixes the tree breakage on macOS stable. Some of our macOS example projects don't have RunnerTest targets, and the default template version of `Podfile` assumes there is one (since it's part of the template project), so re-enabling the CocoaPods build after #11237 requires a small manual change to Podfile. Since any CocoaPods builds of those projects should be manual, that should be fine, but without this PR we are accidentally hitting that in CI.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 16, 2026
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Mar 16, 2026
flutter/packages@91f7c33...0f2eeae

2026-03-16 [email protected] [tool] Add a SwiftPM flag to
fetch-deps (flutter/packages#11258)
2026-03-14 [email protected] [various] Remove CocoaPods from
examples (flutter/packages#11237)
2026-03-14 [email protected] Roll Flutter from
9e36adb to 732e05d (20 revisions) (flutter/packages#11242)
2026-03-13 [email protected] [go_router]
Add `encoder`,`decoder` and `compare` parameters to
`TypedQueryParameter` (flutter/packages#11067)
2026-03-13 [email protected] [camera] Remove outdated TODO in
camera_controller.dart (flutter/packages#11239)
2026-03-13 [email protected] [google_sign_in_web]Fix
renderButton stuck on "Getting ready" for Web (Future<void> issue)
(flutter/packages#11081)

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-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
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:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@stuartmorgan-g stuartmorgan-g deleted the pod-deintegration branch March 17, 2026 16:51
reidbaker pushed a commit that referenced this pull request Mar 17, 2026
Currently the iOS/macOS part of `fetch-deps` uses whatever the default Swift Package Manager setting is, even though the `build-examples` command is always using Swift Package Manager. That means that it's caching a bunch of things we don't need. This PR adds a `--swift-package-manager` flag to `fetch-deps`, and passes the same value we are using for `build-examples`.

This fixes the tree breakage on macOS stable. Some of our macOS example projects don't have RunnerTest targets, and the default template version of `Podfile` assumes there is one (since it's part of the template project), so re-enabling the CocoaPods build after #11237 requires a small manual change to Podfile. Since any CocoaPods builds of those projects should be manual, that should be fine, but without this PR we are accidentally hitting that in CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants