Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode crashes when expanding the "Bundle React Native code and images" phase

enter image description here

I am following the instructions to setup expo-updates for XCode. The last step requires modification in the Bundle React Native code and images phase. However, XCode crashes without any error report as soon as I expand the phase.

Additional Info:

  • Mac Air (Apple M1 chip)
  • XCode 12.4
  • React Native 0.63.4
like image 384
Yao Avatar asked Sep 06 '25 10:09

Yao


1 Answers

The problem is that I do not have a shellScript property for the Bundle React Native codes and images phase. The solution is as follows:

Go to project.pbxproj, search for Bundle React Native codes and images, it should be the parts where you can see the properties such as isa, buildActionMask, files etc.

Add shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";

Here is an example result:

SOME_UNIQUE_ID /* Bundle React Native Code And Images */ = {
    isa = PBXShellScriptBuildPhase;
    buildActionMask = SOME_UNIQUE_NUMBER;
    files = (
    );
    inputPaths = (
    );
    name = "Bundle React Native Code And Images";
    outputPaths = (
    );
    runOnlyForDeploymentPostprocessing = 0;
    shellPath = /bin/sh;
    /* this is the new line added */
    shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
};

Now XCode will not crash when expanding the Bundle React Native codes and images phase.

like image 57
Yao Avatar answered Sep 09 '25 17:09

Yao