Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4862 pages

Upgrades and deprecations

Flutter Swift Package Manager Migration From CocoaPods: What Changes for Apps and Plugins

In short

The Flutter Swift Package Manager migration from CocoaPods happens on its own from Flutter 3.44: the next run adds SwiftPM to your iOS and macOS projects. CocoaPods still runs for any plugin without SwiftPM support, so the real work is checking your plugins, raising deployment targets where a package asks, and removing CocoaPods only when nothing needs it.

What did Flutter 3.44 change for iOS and macOS apps?

From the 3.44 release, Flutter manages iOS and macOS native dependencies with Swift Package Manager, and the app developer guide says the support is on by default. Upgrading Flutter and running the app adds the integration, after which the project downloads the Swift packages that your plugins depend on.

Two files change in a normal app: ios/Runner.xcodeproj/project.pbxproj and the Runner scheme under xcshareddata/xcschemes (or the macOS twins). The project gains a local package called FlutterGeneratedPluginSwiftPackage, and the scheme gains a build pre-action named Run Prepare Flutter Framework Script. If you want to confirm the migration ran, open the workspace in Xcode, run once, and check that the pre-action fires and that the generated package is a dependency of the Runner target.

CocoaPods is not gone. Flutter keeps it in maintenance mode and falls back to it for any dependency that has no SwiftPM support yet. That fallback is why most apps upgrade without touching anything: the plugins that already ship a Package.swift move to SwiftPM, and the rest keep building through the Podfile.

Checked against: source 1

Why the CocoaPods date of 2 December 2026 matters

The Flutter guide says the CocoaPods registry becomes read-only permanently on December 2, 2026, and that turning SwiftPM off will not be allowed in the future. The CocoaPods team's own post on the trunk change gives the detail: from that date trunk stops accepting new podspecs, the Specs repo on GitHub is archived, and no new pods or versions are added.

The same post says existing builds keep working, because the Specs repo and its CDN stay readable. So a pinned Podfile.lock will still resolve next week. What stops is the flow of new versions: a plugin that only publishes through CocoaPods can no longer ship a native update to you through trunk. I read that as the practical deadline for plugin authors, while app teams get a slower squeeze as their pods stop moving.

Checked against: source 1, source 5

Can a Flutter app opt out of Swift Package Manager for now?

Yes, with a warning from the docs to avoid it. If one plugin breaks under SwiftPM, the per project switch lives in pubspec.yaml and applies to every contributor; the three lines are at the end of this section.

Opting out makes Flutter use CocoaPods for all dependencies, but SwiftPM stays wired into the Xcode project. Removing it fully is a separate six step job in Xcode: turn the flag off, run flutter clean, remove the generated package from Package Dependencies and from the Runner target, and delete the pre-action.

  • Per user instead of per project: flutter config --no-enable-swift-package-manager. The guide says every contributor then has to run it.
  • Turning it back on later: flutter config --enable-swift-package-manager.
flutter:
  config:
    enable-swift-package-manager: false

Checked against: source 1

A checklist for the CocoaPods to Swift Package Manager switch in a Flutter app

This order comes from the app developer guide. It ends with CocoaPods removed, which the guide allows only when every plugin supports SwiftPM, since Flutter falls back to CocoaPods otherwise.

  • Upgrade to Flutter 3.44 or later and run the app once, so the automatic migration edits the project.
  • Open the workspace in Xcode and look under Package Dependencies for FlutterGeneratedPluginSwiftPackage. If it is missing, the guide has manual steps; most projects never need them.
  • If you use flavors or custom targets, repeat the pre-action for each flavor; the guide says to use your custom target in place of the default one.
  • Watch for a Target Integrity error saying a package product requires a higher minimum platform version. Raise Minimum Deployments for the app target, then run flutter build ios --config-only (or flutter build macos --config-only). The same error has its own page: package product requires a minimum platform version.
  • Check each plugin's support before going further. If a pod still installs, a plugin still needs CocoaPods.
  • Only then remove CocoaPods: pod deintegrate inside ios, delete Podfile, Podfile.lock, Pods/ and .symlinks/, and delete the CocoaPods #include lines from Debug.xcconfig and Release.xcconfig. Run flutter clean, flutter pub get and flutter run. Custom Podfile logic you added by hand has to go by hand.
  • While pods remain, older failures still apply; pod install failing in a Flutter build covers the common one, and a package graph that never settles in Xcode is under Swift packages stuck resolving.

Checked against: source 1

What plugin authors add: Package.swift and FlutterFramework

The plugin author guide asks for both systems at once: plugins should support SwiftPM and CocoaPods until further notice. It warns that from 3.44, a plugin without CocoaPods support is unusable in apps that have not migrated, and a plugin without SwiftPM support can cause problems in apps that have.

The new package sits in a folder named after the plugin under ios/, macos/ or darwin/, holding Package.swift and Sources/plugin_name/. Swift files move there from ios/Classes; Objective C plugins also get an include/plugin_name folder for public headers. The podspec stays and its source_files path is pointed at the new folder.

Package.swift depends on a local package named FlutterFramework at ../FlutterFramework. That dependency needs Flutter 3.41 or later, so the guide sets the package's pubspec to sdk: ^3.11.0 and flutter: ">=3.41.0". Resource loading changes too: code reads Bundle.module under #if SWIFT_PACKAGE, and the guide notes that call fails when the package carries no resources.

Test both paths before you publish. The guide runs the example app once with SwiftPM disabled plus two pod lib lint passes, then again with it enabled, and warns that the SwiftPM run raises the example app's SDK floor, so leave that change out of the commit if you still support older Flutter releases.

Checked against: source 2

Does SwiftPM support change a plugin's pub.dev score?

It does. The pub.dev scoring help, under its modern toolchains heading, says Flutter plugins that support iOS or macOS only get full score in that part if they support Swift Package Manager. For an app developer that gives a quick filter: a plugin missing those points on its pub.dev page is the one to check first.

Checked against: source 4

Add-to-app and later release notes

The 3.47 release notes, dated 12 August 2026, say the SwiftPM guides grew and the add-to-app pages gained SwiftPM steps for embedding Flutter in an existing iOS or macOS app. The 3.50 notes of 11 November 2026 add more migration guidance for apps and plugins. If your Flutter code lives inside a native app, follow those add-to-app pages; the steps above are written for a Flutter app that owns its Runner project.

The same 3.50 release also starts the move of Material and Cupertino into separate packages, covered in the material_ui and cupertino_ui migration. If an App Store upload is also due, the Xcode 26 and iOS 26 SDK upload rule is the other date to plan around. More upgrade notes sit on the upgrades hub.

Checked against: source 3

What else do people ask?

Does Flutter still use CocoaPods after the Swift Package Manager migration?

Yes, for any plugin that has no SwiftPM support. Flutter falls back to CocoaPods for those, so keep the Podfile until every plugin has moved.

How do I turn off Swift Package Manager in a Flutter project?

Add enable-swift-package-manager: false under flutter: then config: in pubspec.yaml, or run flutter config --no-enable-swift-package-manager per user. The docs advise against it and say the opt out will not be allowed in the future.

Will my CocoaPods builds stop working on 2 December 2026?

The CocoaPods post says existing builds keep working because the Specs repo stays readable. Trunk stops taking new podspecs, so pods stop receiving new versions through it.

Which Flutter version is needed for a plugin's Package.swift?

The FlutterFramework dependency needs Flutter 3.41 or later, and the author guide tells you to work on 3.44 or later, where SwiftPM is on by default.

Why does Xcode say a Swift package requires a higher iOS version after the CocoaPods to SwiftPM move?

The plugin's Package.swift declares a higher minimum platform than your app target. Raise Minimum Deployments in Xcode and rerun flutter build ios --config-only.

When were these facts read?

On 29 November 2026, against Flutter docs that state they reflect Flutter 3.50. Recheck the CocoaPods section after 2 December 2026 and the release notes after each stable release.

Sources

Keep reading

Next step

Have a project in mind?

Tell me about it. A discovery call within 48 hours.