failure to install cocoapods when initializing a react-native project - ios

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
cd ios
pod install
cd ..
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

Related

XCode Build Phase script exit code 1 error React Native

I am working on a React-Native application. I've inherited it, development has been stopped for a while and some of the dependencies are outdated. I do not believe this is part of the problem but worth mentioning. Whatever I do, both on the command line and in XCode, the build fails with the following error:
/bin/sh -c /Users/ME/Library/Developer/Xcode/DerivedData/AppName-cftpundgcnfgkvchyeqvsgfusuhb/Build/Intermediates.noindex/AppName.build/Debug-iphonesimulator/AppName.build/Script-948B6EB41D047ADB00584768.sh
Error loading build config, ignoring
Command /bin/sh failed with exit code 1
What I've done
npm install
In the ios directory, "sudo gem install cocoapods" and "pod install"
react-native run-ios
One way or another, this never works and the error is always the one above
What I've tried
Locking and unlocking the keychain
Deleting the derived data folder, cleaning and re-building
Ticking the "only run for install" checkbox in XCode in the RN bundle section
Using yarn instead of npm
pod deintegrate and install once again
Upgrading react-native
Once more, no luck
I'm fairly new to this and don't fully understand what's going on - or why this is failing. Any ideas as to how to solve it?
Version info
react-native-cli: 2.0.1
react-native: 0.61.5
xcode: Version 12.3 (12C33)
simulator: iphone 11 (ios 14.3)

Setting up react-native development environment at M1 Macbook

Setting
os : Big Sur 11.1
homebrew : 2.7.1
node : 14.15.4
watchman : 4.9.0
Xcode : 12.3
cocoapods : 1.8.4
npx react-native init AwesomeProject
cd AwesomeProject
npx react-native start
cd AwesomeProject
npx react-native run-ios
result(err)
enter image description here
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening AwesomeProject.xcworkspace.
until npx react-native start there's no error
but npx react-native run-ios doesn't work.
I don't get what the problem is. Is Xcode version too high? please help
and how can I build AwesomeProject with Xcode app?. I tried but it failed too.
go to applications and right click on Xcode.app. select the get info. fill the check box of open using Rosseta.if yo want to run iOS with terminal do the steps for terminal.app as well.

How to make sure expo knows SDK is installed in my laptop

I am currently making a react native app and have installed expo but I am getting the error below in the image. I have SDK(29) in my device but how do I make sure that expo knows it.
You don't seem to have made Expo a project.
Did you ran react-native init ??? If yes, it is not an Expo project. it is only react-native project
To make sure that Expo is installed properly: Verify that the
installation was successful by running expo whoami.
If you want an Expo project, run the following command.
expo init AwesomeProject
cd AwesomeProject
npm start # you can also use: expo start
The project you received from Git seems to be a React-native project.
You can try this command.
cd gitproject
npm install
cd ios
pod install
cd ..
npx react-native run-ios or run-android
In the terminal run
expo --version
if installed it will return the version like
5.2.0
else you will get
'expo' is not recognized as an internal or external command,
operable program or batch file.

Failed IOS Build React Native

I downloaded a branch from my github project and when I run the simulator, it runs but the app displays this error.
I have already tried removing the build folder and re running it and I have done npm install when the error displays and running "react-native run-ios". I don't know what to do.
Open additional terminal in the same folder. Run this command.
react-native start --reset-cache
Once the package manager is ready, go back to your first terminal and run your app again.
react-native run-ios

Cant build Cordova ios. Error 65

My steps to make app:
I installed node js
I installed cordova: sudo npm install -g cordova
Then: npm install -g ios-sim
npm install -g ios-deploy
Also I downloaded simulator
Now I should be able to make project so:
cordova create hello com.example.hello HelloWorld
cd hello
cordova platform add ios --save
cordova build
With "cordova build" this error appears:
The following build commands failed:
CompileXIB HelloWorld/Classes/MainViewController.xib
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/xXx/Desktop/Radko/hello/platforms/ios/cordova/build-debug.xcconfig,-project,HelloWorld.xcodeproj,ARCHS=i386,-target,HelloWorld,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/xXx/Desktop/Radko/hello/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/xXx/Desktop/Radko/hello/platforms/ios/build/sharedpch
Working on it for two days and no difference.
As mentioned by Radolnko
Run (This will remove the old cardova ios platform)
sudo cordova platform rm ios
Then (This will install a new platform with privileges)
sudo cordova platform add ios
Then
cordova build
This fixed it for me!
For me it was unchecking my app at Target Membership section in the .xib file itself.
Open the .xib file with xcode and in the right section at the bottom under Target Membership you will see a checkbox with your app's name.
Uncheck it!!!

Resources