Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native ios build failed on react-native run-ios

getting this error

** BUILD FAILED **

The following build commands failed: CompileC /Users/karthikn/AwesomeProject/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Objects-normal/x86_64/RCTTabBarItem.o Views/RCTTabBarItem.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

Installing build/Build/Products/Debug-iphonesimulator/AwesomeProject.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/AwesomeProject.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist

like image 537
furball514 Avatar asked Apr 13 '17 11:04

furball514


3 Answers

Xcode 8.2 still occur same error. Three lines bellow fixed it for me :) Downgrade react(16.0.0-alpha.12 -> 16.0.0-alpha.6) & react-native(0.45.0 -> 0.44.0)
rm -rf node_modules/react
npm i [email protected] -S
npm i [email protected] -S
Then run react-native run-ios

like image 70
thai huynh Avatar answered Sep 22 '22 04:09

thai huynh


Your build could be failing because of the current node js version installed, or due to your pod files or a number of other reasons.

This error may also be when cloning a react native repository from github.

This solution may work as I was able to recreate this issue(refer to the screen shots):

Solution one:

firstly:

If you have the latest version of node js installed you may have some compatibility issues with some of the dependencies, install the recommended version of Nodejs instead.

enter image description here

after installation, reinstall your dependencies and update your pod files:

npm install
cd ios
pod install 

or

pod update

solution two:

this can happen if you haven't installed react native previously on your system and are trying to run a clone react native repository from github.

brew install watchman
sudo gem install cocoapods

then in the rn project clone

 cd ios 
 pod install

Problem:

This is what the error message looks like:

legacy compatibility issues:

enter image description here

Build failed

enter image description here

Solution:

After following the above steps this issue was resolved instantly:

enter image description here

like image 34
Ali Shirazee Avatar answered Sep 20 '22 04:09

Ali Shirazee


If it's your first project, you may have the same problem than me: do NOT use space in your project path! πŸŽ‰ πŸ˜„

like image 40
Floris M Avatar answered Sep 22 '22 04:09

Floris M