I have a project in react native that I havent worked on in a while and it worked last time I worked on it, but now when I try to build I get this error:
build target react-rncore /Users/[user]/Library/Mobile: No such file or directory
now I tried updating xcode I tried to clean the build folder I tried to delete derived data,
I also tried to reinstall everything like so: rm -rf node_modules/
npm install
cd ios/
rm -rf Pods/ Podfile.lock
pod install
but so far nothing seems to work.
here is some more info:
macos 14.3.1
xcode 15.2 15C500b
mac air m1 13′
err log:
Showing All Messages
Build target React-rncore of project Pods with configuration Debug
PhaseScriptExecution [CP-User] Generate Specs /Users/eliaelhadad/Library/Developer/Xcode/DerivedData/danoAesthetics-ddpibeemzkenrfdsrluevuazikkd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-rncore.build/Script-46EB2E0003AA50.sh (in target ‘React-rncore’ from project ‘Pods’)
cd /Users/eliaelhadad/Library/Mobile
/bin/sh: /Users/eliaelhadad/Library/Mobile: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
/Users/eliaelhadad/Library/Mobile: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
now I tried updating xcode I tried to clean the build folder I tried to delete derived data,
I also tried to reinstall everything like so: rm -rf node_modules/
npm install
cd ios/
rm -rf Pods/ Podfile.lock
pod install
but so far nothing seems to work.
2
Answers
what worked for me is doing brew update and updating my mac and Xcode and then cleaning the project in Xcode using Product > Clean Build Folder
after that I deleted derived data Xcode > Preferences > Locations tab to find the path to Derived Data, then navigate to it in Finder and delete the folder related to your project
After all of these steps I built the project and it worked
In my case, the error was because the folder containing the project was inside my iCloud shared folder. When I regenerated the project to a folder on my desktop, the problem was fixed.