arthur nesterenko
All posts

React Native launch troubleshooting in a legacy versions

June 27, 20202 min readreact-native
React Native launch troubleshooting in a legacy versions

This memo will be useful for those who faced issues with running react native < 0.59v on macOS mojave. I have been struggled with running RN 0.55. During the week I was trying to run the app, I have been solving each issue step by step when all the issues had been done I decided to write a small memo to collect all problems that I had in one place.

The first thing you should use legacy build system for your app.

  1. Open XCODE

    file > workspace settings -> build
    system: legacy build system
  2. Try to run:

    react-native run-ios

    The issues that I had during the launch **RN 0.55** using **_Xcode 11_** and mac os **_mojave_** are described below:

1. Could not find iPhone 6 simulator.

  1. Run:

    xcrun simctl list devices
  2. Check available simulators
  3. Run:

    react-native run-ios --simulator 'SIMULATOR_NAME'



2. Success build but simulator crash after launch.

Open node_modules/react-native/React/Base/RCTModuleMethod.mm.

Replace RCTParseUnused method to

    static  BOOL  RCTParseUnused(const  char  **input)
    {
    return  RCTReadString(input, "__attribute__((unused))") ||
    RCTReadString(input, "__attribute__((__unused__))") ||
    RCTReadString(input, "__unused");
    }


Original source


3. Build error: ‘React/RCTImageLoaderProtocol.h’ file not found.

Replace

#import <React/RCTImageLoaderProtocol.h>

to

#import <React/RCTImageLoader.h>


Original source


4.Xcode build fails to download third-party dependencies.

1.

rm -rf node_modules/ && yarn cache clean && yarn install and rm -rf ~/.rncache

2.

cd node_modules/react-native/scripts

3.

./ios-install-third-party.sh

If your network is slow, you can download the packages separately and move them to the rncache folder

  1. folly-2016.10.31.00
  2. double-conversion-1.1.5
  3. glog-0.3.5
  4. boost163_0
cd <Your-Project-Folder>/node_modules/react-native/third-party/glog-0.3.5
../../scripts/ios-configure-glog.sh


Original source



I hope it was useful for you, many thanks.


Share article