sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

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

Open jitenshah19 opened this issue 9 months ago • 0 comments

OS:

  • [ ] Windows
  • [x] MacOS
  • [ ] Linux

Platform:

  • [x] iOS
  • [ ] Android

SDK:

  • [x] @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
  • [x] No

Are you using sentry.io or on-premise?

  • [x] 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.

jitenshah19 avatar May 17 '24 11:05 jitenshah19