Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

React Native init stops with 'Failed to install CocoaPods dependencies'

ErrorError: Failed to install CocoaPods dependencies for iOS project, which is required by this template.

Short answer

The init command only reports that its pod step failed; the real error is hidden. Create the project without the pod step, then run bundle install and bundle exec pod install inside ios to see the actual message. It usually points to Xcode command line tools, a broken CocoaPods gem, or a pinned CocoaPods version.

  • Applies to React Native 0.7x, CocoaPods 1.16, Ruby 3.x, Xcode 26
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Run the pod step yourself so the underlying error shows. The project files already exist; only the pod step failed.

    cd MyApp
    bundle install
    cd ios && bundle exec pod install
  2. 2Match what you see, then jump to its fix

    1. 1The manual run fails while compiling a gem or cannot find build toolsThe Xcode command line tools are missing or not selectedFix
    2. 2pod: command not found, or a Ruby load error, right after a system updateThe CocoaPods gem stopped working after a macOS or Ruby updateFix
    3. 3The manual run builds an old or globally installed pod that differs from the project's GemfileA CocoaPods version the template excludes is installedFix

What does the error look like?

  • Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template.

Cause 1 of 3

The Xcode command line tools are missing or not selected

1Check

The setup guide asks for the latest Xcode and for a Command Line Tools version chosen in Xcode's Locations settings.

xcode-select -p
xcodebuild -version

2Fix

Open Xcode, go to Settings, then Locations, and pick the most recent Command Line Tools version in the dropdown.

xcodebuild -version

3Verify

bundle exec pod install runs without a compile error.

cd ios && bundle exec pod install

Confirmed by reactnative.dev

Did this fix it?

Cause 2 of 3

The CocoaPods gem stopped working after a macOS or Ruby update

1Check

CocoaPods is a Ruby gem, and the CocoaPods troubleshooting guide says an installed gem can stop working after a macOS upgrade.

which pod
gem list cocoapods

2Fix

Uninstall and reinstall the gem, as the guide describes. If gem install fails with a permission error, the guide gives sudo gem install -n /usr/local/bin cocoapods for that case.

gem uninstall cocoapods
gem install cocoapods

3Verify

pod runs and prints its version.

pod --version

Confirmed by guides.cocoapods.org

Did this fix it?

Cause 3 of 3

A CocoaPods version the template excludes is installed

1Check

The template's Gemfile requires CocoaPods 1.13 or newer and excludes 1.15.0 and 1.15.1, which cause build failures. Running a global pod can bypass that pin.

pod --version
bundle exec pod --version

2Fix

Install the Gemfile's gems and run pod through Bundler, so the pinned version is used.

bundle install
cd ios && bundle exec pod install

3Verify

bundle exec pod --version prints a version the Gemfile allows.

bundle exec pod --version

Confirmed by raw.githubusercontent.com

Did this fix it?

How do I stop it coming back?

  • Create projects with --skip-install or --install-pods false when you want the pod step to run in a terminal you can read.
  • Use bundle exec pod install in an existing project, as the template's README does, so the Gemfile version is used.
  • Keep Xcode and its command line tools current before starting a new project.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.