Skip to content
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

sentry-cli react-native xcode not passing arguments to build script #81

Closed
btoueg opened this issue Jun 14, 2017 · 9 comments
Closed

sentry-cli react-native xcode not passing arguments to build script #81

btoueg opened this issue Jun 14, 2017 · 9 comments

Comments

@btoueg
Copy link

btoueg commented Jun 14, 2017

Issuing the command:

sentry-cli react-native xcode ../node_modules/react-native/packager/react-native-xcode.sh

does not fit my use case because I need to pass an argument to react-native-xcode.sh (the ENTRY_FILE)

I've tried both:

sentry-cli react-native xcode ../[...]/react-native-xcode.sh ./path/to/my/entry/file.js
sentry-cli react-native xcode "../[...]/react-native-xcode.sh ./path/to/my/entry/file.js"

Neither of them is working.

My work around is to manually edit react-native-xcode.sh to hard code ENTRY_FILE, which is quite tedious and I'm prone to forget fixing it after each yarn install

@mitsuhiko
Copy link
Member

The reason we let you provide a different build script is precisely to support that. So you could do this:

  1. make a file named mybuild.sh
  2. add these contents:
../node_modules/react-native/packager/react-native-xcode.sh ./path/to/my/entry/file.js
  1. then use sentry-cli react-native-excode mybuild.sh

Does this work for you?

@mitsuhiko
Copy link
Member

Closing this due to inactivity.

@anniewey
Copy link

I faced the same issue and tried @mitsuhiko solution and it's working now!! Thanks lot!

previously i can get it work on sentry/cli: 1.29.1 using
../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh index.js

but after i upgrade to sentry/cli: 1.31.0, its keep prompting this error

error: Found argument 'index.js' which wasn't expected, or isn't valid in this context
USAGE:
    sentry-cli react-native xcode [OPTIONS] [BUILD_SCRIPT] [-- <ARGS>...]

and after tried your method it works!

@AlexUzan
Copy link

AlexUzan commented Jul 9, 2019

@mitsuhiko Hi, I am facing the same issue, and I tried your solution, but now xcode returns me the error Permission denied (os error 13) when trying to run the custom shell script 'Bundle react native code and images'. Do you have any idea why ? My custom script 'bundle_code.sh' is located at the root of my project
Thanks for your help !

@noway
Copy link

noway commented Nov 26, 2019

changing

../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh ./index.js

to

../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh -- ./index.js

seemed to work for me... at least it built the app...

@lukewlms
Copy link

@mitsuhiko I haven't been able to get this working - details here. Is there a concrete example anywhere of exactly where to put the script and how to reference it?

I'm getting: Permission denied (os error 13)

@lukewlms
Copy link

I ended up removing the Sentry build step, because it isn't designed to work with bitcode, which iOS projects will have on by default.

It seems a bit strange that the default Sentry setup would be incompatible with the majority of iOS installations.

@fdobre
Copy link

fdobre commented Sep 29, 2020

@mitsuhiko I haven't been able to get this working - details here. Is there a concrete example anywhere of exactly where to put the script and how to reference it?

I'm getting: Permission denied (os error 13)

I was able to make it build with chmod 755 rnbuild.sh

my xCode bundle command

cd $PROJECT_DIR/..
export SENTRY_PROPERTIES=ios/sentry.properties
export NODE_BINARY=node
./node_modules/@sentry/cli/bin/sentry-cli react-native xcode ./ios/rnbuild.sh

@Alexandria
Copy link

../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh -- ./index.js

seemed to work for me... at least it built the app...

THIS!! This fixed it for me. I am building with react native so instead of making a .sh file I went into my /ios/project.pbxproj file and modified the shellScript string under Bundle React Native code and images. I did a CMD+F and looked for "index.js" and was able to easily find the script.

I then set the path to my index.js file which was in my root. So the path was index.ts and I just changed it to -- ./index.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants