bugsnag / bugsnag-expo

MIT License
11 stars 5 forks source link

Native crashes not reported #191

Closed delphinebugner closed 2 months ago

delphinebugner commented 2 months ago

Describe the bug

Before all, thanks for working on the lib!

When I trigger a native crash, I don't see it reported on BugSnag.

Steps to reproduce

Here's how I triggered a native crash:

  1. Go to a native component used by your app which has an onPress callback
  2. On iOS, add @throw [NSException exceptionWithName:@"IntentionalCrashException" / On Android, throw new RuntimeException("This crash is intentional for testing purposes");
  3. Rebuild
  4. Click on your custom component: app natively crashes
  5. Reopen the app on iOS to ensure native report is sent

Environment

Analysis

I'm using a managed workflow on expo, using expo prebuild to generate iOS and Android folder locally (and EAS build in CD).

There might be something wrong: when I open the generated AppDelegate, I don't see any [Bugsnag start] in the didFinishLaunchingWithOptions - as seen in the classical BugSnag React Native guide: https://docs.bugsnag.com/platforms/react-native/react-native/manual-setup/#app-delegate I can't find Bugsnag pod either.

Because BugSnag is not natively started, I understand I don't see native reports.

Same on Android : opening MainApplication.kt, I don't see Bugsnag.start(this) in the onCreate function.

Did I miss something in the setup, or does the expo bugsnag plugin only works for JS errors? (which does work well on my project)

delphinebugner commented 2 months ago

I just did the test on iOS:

And now my native crash does show up on Bugsnag:

image

Is there an expo plugin Bugsnag to have this automatically added? Or is it managed differently, and the fix is different?

Do you also have recommandation on how to manage dSym files?(see the warning on the screenshot above)

Note: I use @bugsnag/plugin-expo-eas-sourcemaps already

delphinebugner commented 2 months ago

Note: without answer for this, we will probably switch to Sentry

hannah-smartbear commented 2 months ago

Hi @delphinebugner

Our expo notifier does not currently capture native errors, but we have an item on our backlog to add support for this. While I can’t give an ETA for when this will be implemented, you can keep an eye on GitHub issue #53 for any updates on this.

In the meantime, you could try using the React Native plugin to capture your native errors as you have already done, but please note that we can’t guarantee that this will work as expected, and we may not be able to provide support for any issues you come across as a result of using the React Native BugSnag notifier in an Expo app.

Regarding your dSYM issue, have you tried following any of our instructions on uploading dSYMs to BugSnag?

If you have uploaded dSYMs but are still seeing obfuscated stack traces, please feel free to reach out to us at support@bugsnag.com with a link to your dashboard and we can take a deeper look into this.