---
id: "sdk-guides/flutter-cocoapods-to-spm-migration"
title: "Migrate the Flutter SDK from CocoaPods to Swift Package Manager"
description: "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."
permalink: "/docs/sdk-guides/flutter-cocoapods-to-spm-migration"
slug: "flutter-cocoapods-to-spm-migration"
version: "current"
original_source: "docs/sdk-guides/flutter-cocoapods-to-spm-migration.mdx"
---

> **AI agents:** This is the Markdown version of a RevenueCat documentation page. For the complete documentation index, see [llms.txt](https://www.revenuecat.com/docs/llms.txt).

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.

:::warning CocoaPods releases end on December 2, 2026

[CocoaPods trunk becomes read-only](https://blog.cocoapods.org/CocoaPods-Specs-Repo/) 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:

```shell
flutter pub get
```

If this moves you to a new major version, follow its [migration guide](https://github.com/RevenueCat/purchases-flutter/tree/main/migrations).

## 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:

```shell
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:

```shell
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:

1. Run `(cd ios && pod deintegrate)`. If your app uses Bundler, run `(cd ios && bundle exec pod deintegrate)` instead.
2. Delete `ios/Podfile`, `ios/Podfile.lock`, `ios/Pods/`, and `ios/.symlinks/`, where present.
3. In `ios/Flutter/Debug.xcconfig` and `ios/Flutter/Release.xcconfig`, remove any `#include` lines that reference CocoaPods files.
4. Rebuild:

```shell
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](https://www.revenuecat.com/docs/getting-started/installation/flutter) or Flutter's [SPM guide](https://docs.flutter.dev/packages-and-plugins/swift-package-manager/for-app-developers) for custom targets and troubleshooting.
