Cocoa Pods Install on iOS Project Not Working

React-Native: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template

I've found a very similar error reported here, with a solution that suggested:

sudo xcode-select --switch /Applications/Xcode.app

Reading around seems to suggest that somewhere down the updates line, the XCode CLI tools path was set to an incorrect one.

Also as @bibin-jaimon suggested in the comments below, I do have multiple versions of XCode on my machine (why? because of https://stackoverflow.com/a/58329901/606351).

Anyways, problem solved.

How to run CocoaPods on Apple Silicon (M1)

EDIT: I recently disabled Rosetta, and Cocoapods runs just fine with the addition of the ffi gem.

For anyone else struggling with this issue, I just found a way to solve it. In addition to running terminal in Rosetta:

  1. Right-click on Terminal in Finder
  2. Get Info
  3. Open with Rosetta

I installed a gem that seems to be related to the symbol not found in the error:

sudo gem install ffi

After doing this, cocoapods runs as expected.

cocoapods not installing

Using following commands, it worked for me.

  1. sudo gem uninstall cocoapods
  2. sudo gem install -n /usr/local/bin cocoapods
  3. cocoapods pod install

If you encounter this error on step 2:

ERROR: While executing gem ... (Gem::CommandLineError) Please specify at least one gem name (e.g. gem build GEMNAME)

Then try this as step 2 instead (step 3 is not needed):

gem install -n /usr/local/bin cocoapods

Failing to add pod file to Xcode 13 project

Change the project to Xcode 12.0 compatible. Thanks to https://github.com/CocoaPods/CocoaPods/issues/10713#issuecomment-865145924

Sample Image



Related Topics



Leave a reply



Submit