I've build a react-native application and suddenly I get this error message on my terminal during run of the command react-native run-ios. The same code work fine 10 minutes ago and suddenly I get this error message. Please help...
This question is related to
xcode
react-native
build/
folder in ios/
and rerun
if that doesn't do any change thenIn case this doesn't work, don't be sad, there is another solution to deeply clean project
Delete ios/
and android/
folders.
Run react-native eject
Run react-native link
react-native run-ios
This will bring a whole new resurrection for your project
In my case everything solved after re-cloning the repo and launching it again.
Setup: Xcode 12.4 Mac M1
For me it caused by installing react-native-vector-icons and linking by running the react-native link react-native-vector-icons
command.
I just unlinked the react-native-vector-icons by following commands
react-native unlink react-native-vector-icons
cd ios
pod install
cd ..
react-native run-ios
As I already installed an other icon library.
What worked for me was to rename the project by removing the special characters.
Example: "project_marketplace" to "projectmarketplace"
In this case, I redid the project with react-native init and copied the src and package.json folder.
Should always start with the simplest first, after wasting hours and days on this error.
And after an extensive amount of research,
Simply
RESTART YOUR MACHINE
This resolved this error.
I'm on
react-native-cli: 2.0.1
react-native: 0.63.3
This could also be due to having custom named schemes, in that case:
cd ios
xcodebuild -list
Find your's, it might have a -dev suffix. Then:
cd ..
(root of the app)npx react-native run-ios --scheme custom-scheme-name
cd ios && rm Podfile.lock && pod install
worked for me.
In my case, the issue was with my Xcode build scheme. When you run react-native run-ios
you may see something like,
info Found Xcode workspace "myproject.xcworkspace"*
info Building (using "xcodebuild -workspace myproject.xcworkspace -configuration Debug -scheme myproject -destination id=xxxxxxxx-xxxxx-xxxxx-xxxx-xxxxxxxxx -derivedDataPath build/myproject")*
In this case, there should be a scheme named myproject in your ios configurations. The way I fixed it is,
Double clicked on myproject.xcworkspace in ios directory (to open workspace with Xcode)
Navigate into Product > Scheme > Manage Schemes...
Created a Scheme appropriately with name myproject (this name is case-sensitive)
Ran
react-native run-ios
in project directory
After upgrading react-native, you may have stale dependencies. The steps below should fix it.
cd ios
pod deintegrate && pod install
react-native run-ios
Hope this helps, I did this after upgrading to react-native 0.61
I had the same error, but it was caused by the package manager process port being already used (port 8081).
To fix, I just ran the react-native
by specifying a different port, see below.
react-native run-ios --port 8090
If you don't have cocoa pods installed you need to sudo gem install cocoapods
cd ios
pod install
react-native run-ios
if error persists,
1. delete build folder again
2. open the /ios
folder in x-code
3. navigate File -> Project Settings -> Build System -> change (Shared workspace settings and Per-User workspace settings): Build System -> Legacy Build System
run pod install inside ios folder then go back to root folder and run npx react-native run-ios
If you don't have cocoa pods installed you need to:
sudo gem install cocoapods
Then run:
cd /ios
pod install
delete the build
folder in ios
folder of your react native project
run:
react-native run-ios
if error persists:
build
folder again/ios
folder in XcodeHere is the a possible solution
Source: Stackoverflow.com