Build fails on Xcode. Run custom shell script 'Bundle React Native code and images'

See original GitHub issue

After I added sentry I am getting this error while building project.

PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/khagesh/Library/Developer/Xcode/DerivedData/CP-awyselqwjoqrjfeypmvugdxlaeoa/Build/Intermediates/CP.build/Debug-iphonesimulator/CP.build/Script-00DD1BFF1BD5951E006B06BC.sh
export ...
.........
/bin/sh -c /Users/khagesh/Library/Developer/Xcode/DerivedData/CP-awyselqwjoqrjfeypmvugdxlaeoa/Build/Intermediates/CP.build/Debug-iphonesimulator/CP.build/Script-00DD1BFF1BD5951E006B06BC.sh

env: node: No such file or directory

react-native: 0.44 react-native-sentry: 0.14.3 Xcode version: 8.3.3

I am using bitcode, but I don’t think it should fail build.

I believe I followed all steps correctly of setting up sentry and checked sentry.properties file which has all things that are needed. Any help will be much appreciated. Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:9
  • Comments:30 (4 by maintainers)

github_iconTop GitHub Comments

52reactions
ChathuraPcommented, Oct 17, 2017

I also encountered the same issue and fixed and got help from this post. This is actually what happen. “react-native-xcode.sh” script is in two differant paths in two different react-native versions. and this script is referred in x-code build process. please take a look at the images. according to the react-native version, You has to find where is this script and update the path in Xcode then it will start to work. In X-Code project Project > target > Build Phases > Bundle React Native code and images xcodepath

export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh

or

export NODE_BINARY=node
../node_modules/react-native/packager/react-native-xcode.sh

Path 1 YourProject > node_modules > react-native > scripts > react-native-xcode.sh path1

or Path 2 YourProject > node_modules > react-native > packager > react-native-xcode.sh path2

I hope this will be more clear to all.

39reactions
llainecommented, Jul 31, 2017

Doing brew install node solves the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IOS build stack indefinitely on section "Bundle React Native ...
I can build and run the app from XCode, but running from the CI using FastLane it seems to stack on section "Bundle...
Read more >
Build Command Failed Using FastLan… - Apple Developer
I'm currently trying to build my react native app on TestFlight with Fastlane using this tutorial: boorje.com/deploy-react-native-app/
Read more >
Troubleshooting - React Native
This error indicates that the codegen script that is injected into the Xcode build pipeline has exited early. You may get this for...
Read more >
Troubleshooting for React Native | Sentry Documentation
Troubleshoot and resolve common issues with the React Native SDK. ... the build step phase Bundle React Native code and images and patch...
Read more >
[Solution]-React Native Build Failed On IOS - appsloveworld
Change all the 'IPHONEOS_DEPLOYMENT_TARGET = 11.0' to 'IPHONEOS_DEPLOYMENT_TARGET = 12.4'. save and run. Note: every time you pod install, it will change, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found