Skip to content
useffect.sh
Book 30 min with a senior
Native

CocoaPods

React Native’s historical iOS dependency manager (Podfile, pod install, .xcworkspace), in maintenance mode and being replaced by SwiftPM.

Definition

CocoaPods is the dependency manager for Xcode projects that React Native has used on iOS since its beginnings. Native dependencies are declared in a Podfile, resolved by pod install, which writes a Podfile.lock and generates an .xcworkspace to open instead of the .xcodeproj. In a React Native project, the Podfile loads the react_native_pods.rb script and calls use_native_modules!, which automatically links every library found in node_modules through its .podspec file. Environment variables read at pod install are also how you set the architecture, Hermes V1, or precompiled binaries. CocoaPods is in maintenance mode: its maintainers announced that Trunk, the central registry, stops accepting new podspecs on December 2, 2026, after a test run from November 1 to 7; existing specs and the CDN remain available. React Native 0.87 introduced Swift Package Manager as experimental, aiming to make it the default in 0.89. A project’s ios/Pods folder and Podfile.lock come from it.

In a real app

In a project, the clean command is bundle exec pod install from ios/, with the CocoaPods version pinned in Gemfile.lock; a global pod install with a different version is the first cause of “works on my machine”. The variables that matter are passed at the same time: RCT_NEW_ARCH_ENABLED (no effect since 0.82), RCT_USE_PREBUILT_RNCORE=0 to build React Native from source, RCT_HERMES_V1_ENABLED=0 to go back to the previous Hermes. On Expo, the Podfile is generated by prebuild and configured through expo-build-properties (useFrameworks, deploymentTarget), never by hand.

The classic failures: a conflicted Podfile.lock after a merge (regenerate it rather than resolving line by line), a corrupted cache (pod deintegrate then pod install), a library demanding use_frameworks! :linkage => :static while another refuses it, and the familiar download failure on boost or hermes-engine behind a corporate proxy.

For life after CocoaPods, Trunk going read-only does not break existing builds, but libraries will no longer receive updates through that channel. For a React Native project the path is set by core: SwiftPM experimental in 0.87 and 0.88 (npx react-native spm), targeted as the default in 0.89 with a CocoaPods opt-out, and CocoaPods removal in a later release. Expo SDK 58 split its iOS sources into SwiftPM targets to prepare for that move.

Our services on this

Sources

All 35 glossary terms

One of these is blocking your app?

30 minutes with a senior to look at the problem in your code. Free.