Androidian Androidian - 27 days ago 6
iOS Question

Can't build and run react-native project on Mac

Referring this issue, I've the same problem. I've MacOs El Captain on VMware.


  • Node v. 7.8.0

  • npm v.4.6.1

  • react-native-cli 2.0.1

  • react-native 0.46.4

  • Xcode v. 8.2.1



I've two issues:
- when trying to
init
a new react-native project, the packages fetching hangs on getting react-native 0.46.4 package from repo. Other packages were downloaded successfully. So I've execute
npm install
from Windows and then copied the
node_modules
folder on Mac.
- when trying to run the project on iOS simulator I recieve the following error:

** BUILD FAILED **

...
In file included from /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/Bits.h:70:
/Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/React/../third-party/folly-2016.09.26.00/folly/detail/BitIteratorDetail.h:21:10: fatal error: 'boost/iterator/iterator_adaptor.hpp' file not found
#include <boost/iterator/iterator_adaptor.hpp>

The following build commands failed:

CompileC /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/Conv.o /Users/michelebombardi/Desktop/ReactNativeProjects/caliup/node_modules/react-native/third-party/folly-2016.09.26.00/folly/Conv.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

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


I really need to publish my app on the app store before the end of the week.
I've already try all suggested solutions but nothin works.

Could anyone help me?

Answer Source

May be this will work. Try these steps:

  1. Backup your icons, images etc from ios folder.

  2. Check that app name is set for key "name" in {project-root}\app.json file.

  3. Delete ios/ and android/ directories

  4. Run react-native eject

  5. Replace the icons,images etc you copied earlier

  6. Run react-native link

  7. Launch you app from Xcode using short cut key command+r