简体   繁体   中英

failure to install cocoapods when initializing a react-native project

I'm currently running macOS Catalina 10.15.6 and XCode 12.4. I'm trying to create a react native ios app and I'm on the command line running "react-native init Focus" where Focus is the name of my app.

When setting up the app, I get the error "(node:11768) UnhandledPromiseRejectionWarning: Error: Failed to install CocoaPods dependencies for iOS project, which is required by this template"

I try to run "cd./Focus/ios && pod install" which fails, and I have also tried "sudo gem install cocoapods" and "brew install cocoapods" which all fail.

I cannot get past this setup phase of the project.

Fire below code for the setup Project.

npx react-native init ( Your Project Name)

Above code set up your project. And then open your project in IDE which you use for business coding and follow these steps.

Start your react native server by hit the following code

npx react-native start

For the run in iOS do the following steps

  1. cd ios
  2. pod install
  3. cd..
  4. npx react-native run-ios

Or also you can directly run from Xcode after the third step. You do not need to hit the 4 setup

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM