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

How to use Sentry for Multiple iOS Targets in React-Native #573

Open
5 of 11 tasks
jitenshah19 opened this issue May 17, 2024 · 1 comment
Open
5 of 11 tasks

How to use Sentry for Multiple iOS Targets in React-Native #573

jitenshah19 opened this issue May 17, 2024 · 1 comment

Comments

@jitenshah19
Copy link

jitenshah19 commented May 17, 2024

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 5.14.1

react-native version: 0.70.6

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

Link to issue

Configuration:

(@sentry/react-native)

Sentry.init({
  dsn: 'https://[email protected]/...'
});

We have multiple targets in iOS in our React Native app. When I ran the sentry wizard it updated the Bundle React Native code and images section and added a new Run Script under Build Phases for Upload Debug Symbols to Sentry only for the first target.

If I created a Release build for other flavors they wouldn't show stack trace with readable code. It would be only minified.

I had to update /bin/sh -c "$WITH_ENVIRONMENT \"/bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode.sh $REACT_NATIVE_XCODE\"" under Bundle React Native code and images section for each target.

And I also had to create a new Run Script under Build Phases for Upload Debug Symbols to Sentry only for each target with /bin/sh ../node_modules/@sentry/react-native/scripts/sentry-xcode-debug-files.sh

After I did this I could see the stack trace with readable code. Am I missing something?

So every time I add a new target will I have to do this manually? Please guide me if there is a way to automate this for all the targets.

@krystofwoldrich
Copy link
Member

Hi @jitenshah19,
you have not missed anything, the current @sentry/wizard only setups up Sentry for one target.

Thank you for mentioning this, I'll move the issue to the Wizard repository as an feature request to support multiple targets setup.

I'm happy to hear that after adding the steps manually you got the symbolicated errors.

For anyone reading this later, this docs page describes what to add for the auto source maps upload.

https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/

@krystofwoldrich krystofwoldrich transferred this issue from getsentry/sentry-react-native May 27, 2024
@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 27, 2024
@krystofwoldrich krystofwoldrich moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Backlog
Development

No branches or pull requests

3 participants