OS:
Platform:
SDK:
@sentry/react-native (>= 1.0.0)react-native-sentry (<= 0.43.2)SDK version: 2.1.0
react-native version: 0.63.3
Are you using Expo?
Are you using sentry.io or 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]/...'
enableAutoSessionTracking: true,
});
I have following issue:
Crashes are not reported nor in production nor if they are forced with Sentry.nativeCrash();
Steps to reproduce:
none
Actual result:
All exceptions are correctly handled but crashes
Expected result:
Crashes should also be reported
To clarify, what I understand is at Sentry.nativeCrash() actually crashes the app but no report is sent, correct? Can you pass debug: true to Sentry.init on React Native and paste the logs? Thanks.
@jennmueng i tried that and no logs shown for a native crash, however logs are shown when exceptions are captured or when i just throw an error to test.
Sentry.nativeCrash() makes the app crash, yes you understood correct.
Yes but please paste the logs that the SDK outputs to the React Native console when the SDK opens as that contains valuable debug information I need to look at.
Hmm this is unusual then, did you verify that the packages sentry-android and sentry-cocoa are installed on Android and iOS respectively? As the native crashes happens they should be, the fact that they're not logged is highly unusual and would suggest either something wrong with the installation or with those native-level SDKs themselves, however as we haven't heard about any issues from them, nor have any of our end-to-end tests failed so I don't think it's that. If you don't have any error or warning shown in the logs regarding the native SDK then this makes it difficult from our end to diagnose other than letting you know to check the installations.
I tried a fresh install and when npx running the wizard i get the following error:
Running Sentry Wizard...
version: 1.1.4 | sentry-cli version: 1.61.0
Sentry Wizard will help you to configure your project
Thank you for using Sentry :)
Please open
https://sentry.io/account/settings/wizard/{HIDDEN}/
in your browser (if it's not open already)
✅ Patched build.gradle file.
✅ Patched App.js file.
✅ Added sentry.properties file to android
Successfully set up android for react-native
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined
at Object.writeFileSync (fs.js:1410:5)
at /Users/username/.npm/_npx/27422/lib/node_modules/@sentry/wizard/dist/lib/Helper/File.js:23:20
at processTicksAndRejections (internal/process/task_queues.js:93:5)
🎉 Successfully set up Sentry for your project 🎉
Hmm, in your ios folder do you have a sentry.properties? that looks like what went wrong. If it's not there you can copy It over from your android folder to your ios folder.
Also I updated your comment because that URL hash could contain private information.
@jennmueng How can I check if sentry-cocoa not installed after the wizard?
I met the same issues but my log show a warnings about Require cycle after I add Sentry.init to my Splash screen. And I don't see any exceptions or crash on my Sentry dashboard. How can I fix this, please?

@hainguyentien Check in ios/Pods and check if the pod Sentry is present there.
@jennmueng I am having the same issue.
I just tested a crash with the app built on release mode and there I actually got a native crash working... so I guess that is the missing part of the puzzle... it's just reaaaaally confusing though, should definitely be mentioned on the documentation
I'm seeing the same issue on my end. Native crashes are not getting reported. Tried using Sentry.nativeCrash() to generate those crashes. I do see those for release type builds though, but in that case all tags are not reported correctly.
I also verified ios/Pods, Sentry exists in there
Can everyone try a fresh re-install? We recently fixed something in the sentry-wizard that might've caused the issues mentioned here.
@ospfranco, to clarify, native crashing _should_ work on both debug and release builds.
updated it, now on @sentry/react-native version 2.5.2. Still not seeing iOS native crashes
@siddhisuthar Can I see the Sentry.init call that you have on JS? Also when you call Sentry.crash() does it crash the app?
This is the call I make:
Sentry.init({
dsn: SENTRY_DSN,
environment: env,
integrations(integrations) {
return integrations.filter(integration => integration.name !== 'Breadcrumbs');
},
});
Sentry.configureScope(scope => scope.setUser({ id: '' })); // clear automatically set user
And yes, app does crash on Sentry.nativeCrash() but it doesn't show up on Sentry.
@siddhisuthar Can you show the console logs from an iOS device? Not the JS logs but the logs from the device in Xcode when building in debug.
Update: I tried a fresh re-install again, this time with version 2.6.0 and I see those native iOS crashes in Sentry! :tada:
The only issue I noticed is that values set on the scope don't come through for native crashes. I set the user id on the javascript side like this:
Sentry.setUser({ id: userID })
But there is a difference between native errors / js errors:
Sentry.nativeCrash() - Missing expected user id
throw new Error('Test crash: JavaScript') - User id is present and correct
Both these methods are called after Sentry.init & Sentry.setUser.
@siddhisuthar I would need the iOS device logs to debug this, and also maybe your Podfile.lock
I just updated from version 2.4.0 to 2.6.0 and am not able to see any native crashes as well. I then reverted and am not able to see them anymore either.
@k90armstrong Dumb question but I assumed you pod installed when you changed versions correct?
@jennmueng definitely not a dumb question. After lots of fresh installs and toying around with it, I was able to get 2.6.0 working...not sure what exactly got it to work and don't have time to try to recreate it. Thanks!
Same here. Is there any update?
I just newly set up and configured, but I can’t see any crush report from actual device. Not only iOS but also Android.
Test call is working on actual device but the real case is not reported to Sentry.
@Keisuke69 Is the real crash happening before the Javascript call to Sentry.init happens? If that's the case we would not be able to capture it.
@jennmueng
Thank you for the reply.
Is the real crash happening before the Javascript call to Sentry.init happens?
No. I wrote Sentry.init in the top of App.tsx. And real crashes has been happened in another screen (We are using React Navigation).
Also, I find that crashes in the real android device with adb connection send crush reports properly. However, real device with release build does not send the crush report so far.
This release build is built by bitrise and newly installed all dependencies including Sentry module every time.
@Keisuke69 Can you pass debug: true to the call to Sentry.init on Javascript, then attach a debugger to a real iOS/Android device, and send me the device logs from when the crash happens?
Most helpful comment
Update: I tried a fresh re-install again, this time with version 2.6.0 and I see those native iOS crashes in Sentry! :tada:
The only issue I noticed is that values set on the scope don't come through for native crashes. I set the user id on the javascript side like this:
Sentry.setUser({ id: userID })But there is a difference between native errors / js errors:
Sentry.nativeCrash()- Missing expected user idthrow new Error('Test crash: JavaScript')- User id is present and correctBoth these methods are called after Sentry.init & Sentry.setUser.