Error with Cocoa Pods in new project

It’s been a while since I used Expo and I’m getting this problem now when creating a new project with create-react-native-app in which apparently Cocoa Pods fails.

⚠️ Something went wrong running pod installin theios directory. Continuing with initializing the project, you can debug this afterwards.

However, if I follow those instructions, I get another error like this: pod exited with non-zero code: 1.

Aborting run
An unexpected error was encountered. Please report it as a bug:
CocoaPodsError: The command `pod install` failed
└─ Cause: Error: pod exited with non-zero code: 1
    at CocoaPodsPackageManager._installAsync (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:85286)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async CocoaPodsPackageManager.installAsync (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:84649)
    at async runAsync (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:109680)
    at async /Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:109766 {
  code: 'COMMAND_FAILED',
  cause: Error: pod exited with non-zero code: 1
      at ChildProcess.h (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:1073)
      at Object.onceWrapper (node:events:483:26)
      at ChildProcess.emit (node:events:376:20)
      at maybeClose (node:internal/child_process:1063:16)
      at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
      at Object.spawnAsync [as default] (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:558)
      at CocoaPodsPackageManager._runAsync (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:86068)
      at CocoaPodsPackageManager._installAsync (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:84933)
      at CocoaPodsPackageManager.installAsync (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:84660)
      at runAsync (/Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:109688)
      at processTicksAndRejections (node:internal/process/task_queues:93:5)
      at async /Users/abel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-

install/build/index.js:2:109766 {
    pid: 5468,
    output: [ '', '' ],
    stdout: '',
    stderr: '',
    status: 1,
    signal: null
  },
  isPackageManagerError: true
}

npm ERR! code 1
npm ERR! path /Users/abel/Projects/contacts-mobile
npm ERR! command failed
npm ERR! command sh -c pod-install

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/abel/.npm/_logs/2021-03-24T12_06_17_271Z-debug.log

This is the output of my expo diagnostics:

  Expo CLI 4.3.2 environment info:
    System:
      OS: macOS 11.2.2
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 15.5.1 - /usr/local/bin/node
      Yarn: 1.9.4 - /usr/local/bin/yarn
      npm: 7.3.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    Managers:
      CocoaPods: 1.10.1 - /usr/local/bin/pod
    IDEs:
      Xcode: /undefined - /usr/bin/xcodebuild
    npmPackages:
      expo: ~40.0.0 => 40.0.1 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: ~0.63.4 => 0.63.4 
      react-native-web: ~0.13.12 => 0.13.18 
    Expo Workflow: bare

Seems to be an error with Cocoa Pods but i’m not versed in the matter at all. Any help?

Hey @abeltama, looking at your diagnostics report it looks like there might be an issue with your Xcode. I just ran npx create-react-native-app without issue running the same cocoapods version as you.

Cheers,
Adam

Thanks for the heads up. I had not idea I had to do that first.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.