Android doesn’t have any problems with react-Native, IOS just doesn’t work.

MAC 10.14.4 xcode 10.2.1

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening reactNative.xcodeproj
Copy the code

The solution

  1. Delete project dependency packages and the YARN cache
rm -rf node_modules && yarn cache clean
Copy the code
  1. To pack again
yarn install
Copy the code
  1. Clear the React-native cache
rm -rf ~/.rncache
Copy the code
  1. Download the React-Native IOS runtime dependency

Run the react-native run-ios project directly to download the script

node_modules/react-native/scripts/ios-install-third-party.sh
Copy the code

Fix the slow download of IOS

Domestic download is quite slow, this time will be reasonable use of download tools. I use proxy-Down, an open source download tool, to configure the proxy.

View the file to download

cat node_modules/react-native/scripts/ios-install-third-party.sh
Copy the code

The output is as follows

#! /bin/bash
# Redundant items are not displayedFetch_and_unpack glog - 0.3.5. Tar. Gz https://github.com/google/glog/archive/v0.3.5.tar.gz 61067502c5f9769d111ea1ee3f74e6ddf0a5f9cc"\"$SCRIPTDIR/ios-configure-glog.sh\""Fetch_and_unpack double - conversion - 1.1.6. Tar. Gz https://github.com/google/double-conversion/archive/v1.1.6.tar.gz 1c7d88afde3aaeb97bb652776c627b49e132e8e0 fetch_and_unpack boost_1_63_0.tar.gz https://github.com/react-native-community/boost-for-react-native/releases/download/v1.63.0-0/boost_1_63_0.tar.gz C3f57e1d22a995e608983effbb752b54b6eab741 fetch_and_unpack folly - 2018.10.22.00. Tar. Gz https://github.com/facebook/folly/archive/v2018.10.22.00.tar.gz f70a75bfeb394363d2049a846bba118ffb3b368aCopy the code

Four download links are key, use the tool to download these four files. The download link is closely related to the React-Native version, please check the file version carefully.

  1. Github.com/google/glog…
  2. Github.com/google/doub…
  3. Github.com/react-nativ…
  4. Github.com/facebook/fo…

After the download is complete, create a.rncache folder and move the four downloaded files to the directory

mkdir ~/.rncache
Copy the code

Run the installation script again, because it all runs quickly using a local download file.

node_modules/react-native/scripts/ios-install-third-party.sh
Copy the code

Run the project and you can run it. It will be a little slow for the first time. Just be patient.

react-native run-ios
Copy the code

reference

  1. Github.com/facebook/re…