4
votes

I am very new to react native. I have created a Hello World project and unable to run it on iOS. Every time when i run the project for iOS it throws the following error(s)

** BUILD FAILED **

The following build commands failed: CompileC /Users/usman/FunZoneAppsProjects/{ProjectName}/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTShadowView+Internal.o Views/RCTShadowView+Internal.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

Installing build/Build/Products/Debug-iphonesimulator/{ProjectName}.app An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/{ProjectName}.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist

Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/{ProjectName}.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist

at checkExecSyncError (child_process.js:621:11)
at Object.execFileSync (child_process.js:639:13)
at Promise.then (/Users/usman/FunZoneAppsProjects/{ProjectName}/node_modules/react-native/local-cli/runIOS/runIOS.js:208:5)

I have read many people resolved this issue with different fixes but none of them worked for me. What can be the issue? TIA

3

3 Answers

2
votes

I think this is connected with the new xcode version. Try opening your project in xcode. Go to File->Project Settings and choose Legacy build. Then try to rebuild your project.

0
votes

What worked for me on mac OS Big Sur and Xcode 12 was,

  1. Delete package-lock.json file.
  2. Run npm install and cd ios && pod install && cd ..
  3. Then opened the .xcworkspace file from Xcode and it worked.
-1
votes

First of all you should be secure that brew, node and watchman are installed. After that, try to follow these steps.

  1. Delete your actual project, close simulator, xcode and run on the path folder of your project watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean. Finally, close the command line

  2. Create a folder in desktop named RNProjects. Open the command line and run cd Desktop/RNProjects.

  3. Run in the command line react-native init myProjectName. You can name the project as you want. You should change "myProjectName" for the desired project name.

  4. After installation is completed (it takes a couple of minutes), be sure that in the command line you are in the path RNProjects and then run cd myProjectName. If you gave the project a different name, just replace "myProjectName" for the real project name.

  5. Finally, just run react-native run-ios. Let me know if you want to test it in a real iDevice.

EDIT 1

If brew, node or watchman are not installed yet, follow this

  1. For HOMEBREW follow this link. you should paste that at a Terminal prompt. /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  2. After that run brew install node

  3. Then run brew install watchman
  4. Then run npm install -g react-native-cli
  5. Install Xcode command line tools follow this link