---
id: "sdk-guides/react-native-cocoapods-to-spm-migration"
title: "Migrate the React Native SDK from CocoaPods to Swift Package Manager"
description: "Use this guide for a React Native Community CLI app that manages its own ios/"
permalink: "/docs/sdk-guides/react-native-cocoapods-to-spm-migration"
slug: "react-native-cocoapods-to-spm-migration"
version: "current"
original_source: "docs/sdk-guides/react-native-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).

Use this guide for a React Native Community CLI app that manages its own `ios/`
project. React Native's Swift Package Manager (SPM) integration is
[experimental](https://github.com/react/react-native/blob/v0.88.0/packages/react-native/scripts/spm/__docs__/spm-scripts.md).
Keep Expo apps on CocoaPods for now; see [Expo apps](#expo-apps). React Native doesn't yet recommend this integration for production.

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

- React Native **0.88.0 or later**.
- An app that currently installs React Native Purchases through CocoaPods and is
  committed to version control. Keep CocoaPods installed: the conversion uses it
  to remove the existing integration.
- SPM support in every React Native library with native iOS code. If
  `spm add` reports `Package.swift is missing for library "<name>"`, follow
  [React Native's guidance](https://github.com/react/react-native/blob/v0.88.0/packages/react-native/scripts/spm/__docs__/spm-scripts.md#community-packages-without-a-packageswift)
  to generate one.

Run the following commands from the app root on macOS.

## 1. Update the RevenueCat packages

Install `react-native-purchases` **11.0.0 or later**, and the same version of
`react-native-purchases-ui` if you use it. If you're upgrading from an earlier
major version, apply the
[v11 API changes](https://github.com/RevenueCat/react-native-purchases/blob/main/migrations/v11-MIGRATION.md).

Don't run `pod install` after updating: the next step removes React Native's
CocoaPods integration, and RevenueCat then comes from SPM.

## 2. Convert the Xcode project

If your app manages CocoaPods through a `Gemfile`, run:

```sh
bundle exec npx react-native spm add --deintegrate
```

Otherwise, run `npx react-native spm add --deintegrate`.

RevenueCat autolinks from the installed npm packages. You don't need to scaffold
manifests or add RevenueCat packages manually in Xcode. Remove any previous manual
RevenueCat pod or framework integration for the migrated target.

## 3. Remove the old CocoaPods files

If other native dependencies still need CocoaPods, follow
[Keeping other pods](#keeping-other-pods) instead of this step.

Remove `ios/Podfile`, `ios/Podfile.lock`, and `ios/Pods/`. Remove the app-level
`.xcworkspace` only if CocoaPods was its sole purpose; keep custom workspaces.
Open the `.xcodeproj`, or your custom workspace. Update any scripts that still
reference the deleted CocoaPods workspace.

Earlier versions of React Native Community CLI find your iOS project through its
`Podfile`, so they can't find it once the `Podfile` is gone. Install the SPM-aware
CLI **in this app**, keeping its packages at the same version:

```sh
npm install --save-dev --save-exact \
  @react-native-community/cli@21.0.0-alpha.1 \
  @react-native-community/cli-platform-ios@21.0.0-alpha.1 \
  @react-native-community/cli-platform-android@21.0.0-alpha.1
```

Omit the Android package for an iOS-only app. Use your package manager's equivalent
command if needed.

## 4. Build and verify

```sh
npx react-native run-ios
```

Also build Release and validate your release archive. In your existing test
environment, fetch offerings and complete a purchase. If you use RevenueCatUI,
also open any paywall or Customer Center your app uses.

Commit the package-manager lockfile, Xcode project, `.spm-injected.json`, shared
scheme, and `.gitignore` changes. Keep generated `ios/build/` files ignored.

## Keeping other pods

Follow this section instead of step 3 if your app keeps CocoaPods dependencies that aren't part of React Native.

RN 0.88 removes directive lines from the Podfile, which can leave invalid Ruby.
Before running `pod install`, remove leftover `use_react_native!` arguments,
RN-only `require` statements, `react_native_post_install` calls, and references
to the removed `config` variable. Replace `min_ios_version_supported` with your
app's deployment target. Preserve setup required by the remaining pods.

From the `ios` directory, run `pod install`. If you use Bundler, run
`bundle exec pod install` instead. Open the `.xcworkspace`. The remaining pods
must not pull in another copy of React Native or RevenueCat.

## Expo apps

Keep Expo apps on CocoaPods. Expo SDK 58 adds SPM support as a preview, but common
Expo libraries such as `expo-router` don't support SPM yet.

The `PurchasesHybridCommon` 20.1.0 pod that React Native Purchases 11.0.0 depends
on isn't available on CocoaPods until after November 6, 2026. Until then, stay on
React Native Purchases 10.x.

## Troubleshooting

### Missing Swift packages after cloning

React Native's generated packages under `ios/build/` aren't committed. If Xcode
reports missing packages after cloning, install JavaScript dependencies, then run
this on macOS:

```sh
npx react-native spm update --yes
```

Reopen the project in Xcode and build again.

## Next steps

See the [React Native install guide](https://www.revenuecat.com/docs/getting-started/installation/reactnative) for SDK setup.
