Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niksudan/73d9093cc59f723f095bce15e41b6c9a to your computer and use it in GitHub Desktop.
Save niksudan/73d9093cc59f723f095bce15e41b6c9a to your computer and use it in GitHub Desktop.
Fixing Third Party React Native Dependencies for Xcode

Xcode and React Native love to complain about errors. I've found that with certain projects need this additional configuration step in order for it to actually run.

Here's what to do:

  1. Remove all currently installed node modules and caches, and re-install them.
rm -rf node_modules/ && yarn cache clean && yarn install
rm -rf ~/.rncache
  1. Manually install the third party dependencies by entering the following folder.
cd node_modules/react-native/scripts
./ios-install-third-party.sh
  1. Move the created folder into the root directory of react-native (you might need to remove it if it already exists).
mv ./third-party ../
  1. Configure the glog dependency by being in the right place and running the right script.
cd ../third-party/glog-0.3.4
../../scripts/ios-configure-glog.sh
  1. If the error "xcrun:_ error: SDK "iphoneos" cannot be located" occurs, you need to run the following script and then run step 4 again.
sudo xcode-select --switch /Applications/Xcode.app
  1. Open up the .xcodeproj or .xcworkspace file and select Project -> Clean Build Folder.

  2. Select iPhone X (or the device of your choice) and then select Project -> Build.

  3. Click the run button if there are no errors.


References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment