Skip to content

How to Fix React Native CocoaPods Install Errors

DodaTech 2 min read

In this tutorial, you'll learn about How to Fix React Native CocoaPods Install Errors. We cover key concepts, practical examples, and best practices.

The Problem

pod install fails with Unable to find a specification for 'React-Core' or The 'Pods-YourappTests' target has transitive dependencies that include static binaries. These errors happen when the Podfile references outdated React Native subspecs, CocoaPods itself is outdated, or the spec repository has not been updated. React Native's iOS integration relies heavily on CocoaPods, and version mismatches between them are the most common cause of iOS build failures.

Quick Fix

1. Update CocoaPods and its spec repo

sudo gem install cocoapods
pod repo update

Expected output:

Updating spec repo master
$ pod repo update
CocoaPods 1.15.2 installed successfully

Check your CocoaPods version:

pod --version

Expected output:

1.15.2

2. Regenerate the Podfile for the current React Native version

For React Native 0.73+, create a fresh Podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, min_ios_version_supported

target 'YourApp' do
  config = use_native_modules!
  use_react_native!(:path => config['reactNativePath'])

  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
  end
end

3. Clean and reinstall pods from scratch

cd ios
rm -rf Pods Podfile.lock
pod install --repo-update

Expected output:

Analyzing dependencies
Downloading dependencies
Installing React-Core 0.73.4 (was 0.72.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 42 dependencies.

4. Fix Hermes and Flipper conflicts

If you see Flipper-related errors, disable it:

# In Podfile, inside the target block
:flipper_configuration => false

For Hermes, ensure it is enabled in your Podfile:

use_react_native!(
  :path => config[:reactNativePath],
  :hermes_enabled => true
)

5. Isolate the issue with verbose mode

pod install --verbose 2>&1 | grep -i error

Expected output (if clean):

# no lines — install succeeded

Additional Troubleshooting

# Check the error message and stack trace for more context
echo "Review the full error output to identify the root cause"

If the above steps do not resolve the issue, examine the complete error message and stack trace. Often the key detail is in the middle of the traceback rather than the final line. Search for the error message in the project documentation or issue tracker for additional solutions.

6. Switch to the New Architecture if pods conflict

# In react-native.config.js
module.exports = {
  project: {
    ios: {
      newArchEnabled: true
    }
  }
};

The new architecture uses JSI instead of the bridge and has fewer CocoaPods conflicts.

Prevention

  • Run pod repo update before every pod install in CI pipelines
  • Keep CocoaPods version at 1.12 or higher for React Native 0.72+, 1.14+ for 0.73+
  • Commit Podfile.lock to lock all pod dependency versions
  • Delete both Pods/ and Podfile.lock together when switching React Native versions
  • Add ios/Pods/ and ios/Podfile.lock to .gitignore only if you are comfortable with non-reproducible builds

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro