-
-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build fails on Xcode. Run custom shell script 'Bundle React Native code and images' #141
Comments
Do you have node.js installed?
2017年7月7日 +0100 AM9:45 Khagesh Sharma <[email protected]>,写道:
… 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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
yes, I have node.js 6.9.0 |
As your error log suggests, the error came out from running Maybe you can try to run |
I ran Unfortunately I don't know much about build phase and how to add or debug custom scripts. If there is some path which I can follow to debug it. That would help me. |
Spent few hours trying to solve this. It was weird that the file mentioned actually did exist (in your case See this pull request https://github.com/getsentry/react-native-sentry/pull/139/files |
That is true for react native 0.46+. However, I don't think it is solution for the problem in general. Also, I am using react native 0.44 and unfortunately we are not planning an upgrade as of now. But the good news for me is that I solved my issue and also found out the seeming root cause after learning about custom build phases in xcode project. Here is what I did to resolve my issue. Since What react-native-sentry updated export SENTRY_PROPERTIES=sentry.properties
export NODE_BINARY=node
../node_modules/sentry-cli-binary/bin/sentry-cli react-native xcode
../node_modules/react-native/packager/react-native-xcode.sh" I changed it to add export SENTRY_PROPERTIES=sentry.properties
export NODE_BINARY=node
node ../node_modules/sentry-cli-binary/bin/sentry-cli react-native xcode
../node_modules/react-native/packager/react-native-xcode.sh" After resolving this issue I faced same issue with #!/bin/bash
# Setup nvm and set node
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
. "$HOME/.nvm/nvm.sh"
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
. "$(brew --prefix nvm)/nvm.sh"
fi
# Set up the nodenv node version manager if present
if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then
eval "$("$HOME/.nodenv/bin/nodenv" init -)"
fi
[ -z "$NODE_BINARY" ] && export NODE_BINARY="node"
# Run sentry cli script to upload debug symbols
$NODE_BINARY ../node_modules/sentry-cli-binary/bin/sentry-cli upload-dsym And then I replaced build phase with something like this and everything started working. export SENTRY_PROPERTIES=sentry.properties
export NODE_BINARY=node
../build-phase-scripts/upload-dsym.sh Root cause for all of these issues that I strongly believe is how As to why I had to create a bash script for |
I'm using nvm and I have the same issue during xCode building. |
did you recently update to react native >0.46? |
@grigored Yes, I'm using 0.46.1. This's not my first time to meet this error, it also occurs on RN 0.45 and I'm stilling waiting for the official fixing :( |
I've also found that using node through NVM was a problem and installed using brew. NVM node works fine under linux for android builds however |
@benhowes Thanks for this. In the end switching to node using Brew is what fixed it for me. |
It seems this is the way to fix it if you are using |
I think we can update the docs to let people know what to do in case of |
@khagesh Good idea, will do that. 👍 |
Thanks writing the document will help us :) |
Doing |
@grigored thank you. This solved my issue. |
Guys could you someone explain to me briefly what is that modification of "React Native Bundle" phase even necessary? Original script in bundle phase: After installing sentry: |
So the step The |
For me I had to remove react-native-sentry by using Next I had to remove references to Sentry in my In the build phases of my project target I removed this line from "Bundle React Native code and images": After building the project it was able to run again, so I re-added the Sentry package and went through the installation process with:
And it is now working, hope this helps! |
I'm upgrading from a pretty old version of Sentry and got it working by changing the path from
|
I ran into this after having updated node and realized (after way too long) that the run script was pointing to a node binary that no longer existed on my system 😂 |
If you take this solution, just make sure you still have the config file in there. Otherwise, it'll yell at you to add the |
This is still a problem. Another fix is here for NVM users: https://stackoverflow.com/a/50419734/8676545 Create symlink:
|
For me, I renamed my Sentry project and ran into this error... after wasting my life on hunting node issues all it took was setting the |
Guys, there is still no clear solution as far I as I can see.
I see that the above is now the "sanctioned" solution as per the docs, but it is not a good solution because I don't want to override node system-wide! Any other ideas? |
FWIW what I ended up doing is modifying the last 2 lines of the build steps "Bundle react native node and images" AND "Upload debug symbols to Sentry" to:
This forces the sentry CLI script to use the same version of node as my project. IMO your docs should be updated with a better solution |
Facing the same issue in React Native 0.69.3 |
Here is solution from Sentry docs |
The solution for our team was to specify the correct cli executable within our
|
@sinn1 Big thanks. |
After I added sentry I am getting this error while building project.
react-native
:0.44
react-native-sentry
:0.14.3
Xcode version
: 8.3.3I 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!
The text was updated successfully, but these errors were encountered: