Migrate the Flutter SDK from CocoaPods to Swift Package Manager
Move the RevenueCat Flutter SDK's iOS and macOS dependencies from CocoaPods to Swift Package Manager
Move the RevenueCat Flutter SDK's iOS and macOS dependencies to Swift Package Manager (SPM). Flutter can keep using CocoaPods for other plugins that still need it.
CocoaPods trunk becomes read-only on December 2, 2026. Existing versions remain available; migrate to Swift Package Manager to keep receiving RevenueCat's native SDK updates.
Prerequisites
- Flutter 3.44 or later, where SPM is enabled by default, or Flutter 3.27–3.41 with SPM enabled manually.
- A working app committed to version control.
1. Update the RevenueCat packages
In pubspec.yaml, use purchases_flutter 9.10.0 or later, and the same version of purchases_ui_flutter if you use it. If your constraint doesn't allow 9.10.0 yet, raise it, then run:
flutter pub get
If this moves you to a new major version, follow its migration guide.
2. Check your deployment target
In Xcode, open ios/Runner.xcworkspace, select Runner > General > Minimum Deployments, and set iOS 13.0 or later. For macOS, do the same in macos/Runner.xcworkspace with macOS 10.15 or later.
Set it in Xcode even if your Podfile already sets a platform version: Swift Package Manager checks the Xcode setting.
3. Enable Swift Package Manager
Skip this step on Flutter 3.44 or later unless you previously disabled SPM. Otherwise, run:
flutter config --enable-swift-package-manager
Remove enable-swift-package-manager: false under flutter.config in pubspec.yaml, if present. Older projects may instead have disable-swift-package-manager: true directly under flutter; remove that setting too.
4. Build and verify
Run the app on an iOS device or simulator, and on macOS if supported:
flutter run
If the build fails with requires minimum platform version, raise the deployment target from step 2, run flutter build ios --config-only (or flutter build macos --config-only), and rebuild.
Check that RevenueCat now comes from SPM: if ios/Podfile.lock (or macos/Podfile.lock) exists, it no longer lists PurchasesHybridCommon.
Then build a release archive and open any paywall or Customer Center your app uses. Missing resources only show up at runtime, not as build errors.
5. Remove CocoaPods if it is no longer needed
This step is optional. Flutter falls back to CocoaPods for plugins without SPM support, so remove it only when every plugin supports SPM. If you added pods or other custom logic to your Podfile, migrate them first: they're deleted with it.
For iOS, from the app root:
- Run
(cd ios && pod deintegrate). If your app uses Bundler, run(cd ios && bundle exec pod deintegrate)instead. - Delete
ios/Podfile,ios/Podfile.lock,ios/Pods/, andios/.symlinks/, where present. - In
ios/Flutter/Debug.xcconfigandios/Flutter/Release.xcconfig, remove any#includelines that reference CocoaPods files. - Rebuild:
flutter clean
flutter pub get
flutter run
For macOS, repeat in macos/, using macos/Flutter/Flutter-Debug.xcconfig and macos/Flutter/Flutter-Release.xcconfig.
6. Commit your changes
Commit pubspec.yaml, pubspec.lock, and the changes under ios/ and macos/, including the shared scheme and any CocoaPods cleanup.
On Flutter 3.27–3.41, flutter config --enable-swift-package-manager applies only to the machine you run it on. Run it on CI and every developer machine too. In build scripts, remove pod install steps only for platforms that no longer use CocoaPods.
Next steps
See the Flutter install guide or Flutter's SPM guide for custom targets and troubleshooting.