Failed IOS Build React Native - ios

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

Related

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
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

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.

React Native archive error: Unable to find React Native files. Make sure "react-native" module is installed in your project dependencies

I'm trying to archive my (otherwise perfectly building, running on simulator/device for debug) iOS app built with React Native.
When I try to archive in Xcode, it compiles and links correctly but while trying to generate assets the following command is invoked:
node '/Users/Can/Documents/Programming/React Native/REDACTED/node_modules/react-native/cli.js' bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/Can/Library/Developer/Xcode/DerivedData/REDACTED-eebdhuhscigvmvduljehleepetoi/Build/Intermediates.noindex/ArchiveIntermediates/REDACTED/BuildProductsPath/Release-iphoneos/REDACTED.app/main.jsbundle --assets-dest /Users/Can/Library/Developer/Xcode/DerivedData/REDACTED-eebdhuhscigvmvduljehleepetoi/Build/Intermediates.noindex/ArchiveIntermediates/REDACTED/BuildProductsPath/Release-iphoneos/REDACTED.app
It fails with error:
error Unable to find React Native files. Make sure "react-native" module is installed in your project dependencies.. Run CLI with --verbose flag for more details.
(Before you ask, yes, react-native is installed in my project dependencies, obviously)
When I invoke that exact node command manually, it generates assets perfectly fine:
warning: the transform cache was reset.
Loading dependency graph, done.
info Writing bundle output to:, /Users/Can/Library/Developer/Xcode/DerivedData/REDACTED-eebdhuhscigvmvduljehleepetoi/Build/Intermediates.noindex/ArchiveIntermediates/REDACTED/BuildProductsPath/Release-iphoneos/REDACTED.app/main.jsbundle
info Done writing bundle output
info Copying 30 asset files
info Done copying assets
I am unable to archive my app because of this. It suggests me to run CLI with --verbose flag but I have no idea where to add the flag as the command itself is invoked from an autogenerated/complicated script.
What am I doing wrong? I am on Xcode 10.2 and React Native 0.59.3.
According to the error Make sure "react-native" module is installed you are not on the project root path. So delete the derived data and OPen Terminal & set Project Path
cd ../projectpath_foldername
run the command
npm start
after that
react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios
Now run
react-native run-ios
once its build and run open the xcode and archive your app.
After investigating some issues such as https://github.com/facebook/react-native/issues/22354 I've found the problem after several hours:
I had a space in my project path. I've moved my project to a path without space and it started to archive perfectly. Apparently, it really was a bug with React Native.

React Native app not running in XCode iOS simulator

I try to make my first steps using React Native. Development for Android (on Windows host) works. Now I wanted to test iOS, and tried to set up a development environment on a MacBook Pro.
Problem: React Native starts the iOS simulator, and then nothing happens any more. The simulator runs OK, but my React native app won't start.
What do I need to do to get my React Native installation going?
More Info:
I set up XCode and React Native according to the docs on the MacBook Pro running OSx 10.13.2 (High Sierra). XCode was installed and tested successfully, including the simulator.
When I installed Node.js I deliberately picked an older version (containing npm 4.2.0), since forums say that React Native does still have problems with npm 5. I also installed Homebrew and Watchman, like stated in the docs.
To initialize an empty project, I used
create-react-native-app HelloWorldProject
and a projet structure got created in my Documents folder.
If I finally fire up my "Hello World" test app using
cd HelloWorldProject
sudo react-native run-ios
the system responds:
Starting packager ...
Starting simulator ...
and then nothing happens. The simulator does indeed start (boot --> apple logo --> progress bar --> IOs start screen), but nothing happens afterwards.
Edit
I have given up on React Native for several reasons, I leave this question here for documentary purposes, but I cannot verify or accept any answer, I don't have a React Native development environment any more.
It's probably because you used sudo. /.expo/ is owned by root. Try to change the ownership with
sudo chown -R `whoami` ~/.expo
Refer https://github.com/react-community/create-react-native-app/issues/422
Even everything in your app seems fine, sometime you face the issue that the app is taking too much time to load either through terminal or Xcode. If there is no any other specific issue with your project, the following solution works most of the time:
Go to your app folder and then go to 'iOS' folder.
Delete 'Podfile.lock' and 'Pods' folder.
Execute the following command in Terminal from your 'ios' folder, that will bring back the 'Podfile.lock' and required Pods will be installed to 'Pods' folder:
pod install
Delete the 'build' folder in your 'iOS' folder.
Run the following command in terminal:
react-native run-ios
While the terminal is running, open '.xcworkspace' in your 'ios' folder in Xcode.
The above steps will make sure it will be build your react native project newly and will run on the simulator.
Thanks
Wasantha Wijayaratna

Develop React-native IOS app

when I developed the first app I got error .I'm new to react
please help me to find a solution.
I install npm,node,flow,watchman ,homebrew
Your package server isn't running. This should start automatically when you hit run in xcode, but you can also start it manually. From the project's root, run npm start

Resources