I have create sample React Native project and following the tutorial as per react native website.
I have try to run the application IOS simulator, its throwing error
Try to add CFBundleIdentifier in the Info.plist as:
<key>CFBundleIdentifier</key>
<string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
This may happen because of some library files not found.You need to follow some steps That I have done and it is worked perfectly for me. 1.) go to Xcode project -> Target -> select build Phase -> Go to target dependies -> Click on + -> add "react" and press add.
2.) Xcode > Product -> scheme > manage sceme -> click on + button -> targetName(React) -> Okay -> make shared of this by select checkbox under shared column.
3.) Clean your project and try to build, If it is getting some error like "glog/logging.h file not found" or "cofig.h file not found" in Xcode and "CFBundleIdentifier not exist" then do not worry. You are just one step far. This is may occurs if you are missing config.h file, For this you need to update config.h file. For this
4.) follow below steps a.) close your Xcode b.) Open terminal with the project (Or you can directly left click your project and drag your folder to closed terminal, [It will automatically take the path from your that corresponding folder]) c.) write command
cd node_modules/react-native/third-party/glog-0.3.4/
d.) Run the configure scripted file by the command
./configure
e.) now close terminal and go to terminal with your project root path. now try final run your iOS project by
react-native run-ios
Happy Coding :)
Run the command
react-native upgrade
react-native run-ios
or
react-native run-android
this was solved when am faced this issue
For XCODE 10.0, I did two things
1) check out this answer which basically says Go to File -> Project settings
Click the Advanced button
Select "Custom" and select "Relative to Workspace" in the pull down
Change "Build/Products" to "build/Build/Products"
2) If (1) doesn't work for you then open your project from xcode go to project navigator and select your project name --> go to info --> use debug for command-lines builds.
do this
3) go to terminal and react-native run-ios
In my case, just delete the build
directory, Pods
directory, node_modules
directory and running yarn install
, pod install
and npx react-native run-ios
solves the issue.