Sentry-react-native: Cannot trigger nativeCrash

Created on 31 Aug 2017  ·  6Comments  ·  Source: getsentry/sentry-react-native

I have just imported Sentry to my project and I can capture message with Sentry.

However, when I have tried to fire Sentry.nativeCrash(), there is nothing happen.

_Platform:_

  • [Y] iOS

Output of npm ls --prod --depth=0

├── UNMET PEER DEPENDENCY [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (git+https://github.com/g6ling/react-native-dropdown.git#12cd976c8131706134f1a042bb88c4bdb82965ac)
├── [email protected]
├── [email protected] (git+https://github.com/forcedotcom/SalesforceMobileSDK-ReactNative.git#b14b4e6df5f9414c7fe7b452f73c694f145e76cf)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (git+https://github.com/ForceDotComLabs/react.force.git#2995463b74b3d5415f26e04f4d5ba92b9bbc6276)
├── [email protected] (git+https://github.com/ForceDotComLabs/react.force.data.git#8101b40e9eceebb67477fd6059c22995f7d330dc)
├── [email protected] (git+https://github.com/ForceDotComLabs/react.force.datacontainer.git#d46459e2b5efc9b8f5b327b7d82b1496dfcb30e4)
├── [email protected] (git+https://github.com/forcedotcom/SalesforceMobileSDK-Android.git#73d6e8564c84c86081304d896bd1605345d5f529)
├── [email protected] (git+https://github.com/forcedotcom/SalesforceMobileSDK-iOS.git#9518a21ce2aea6921d644d5c80b97975e3cb9a94)
└── [email protected]

npm ERR! peer dep missing: react@>=15.2.0, required by [email protected]
npm ERR! peer dep missing: react@^0.13.0 || ^0.14.0 || ^15.0.0, required by [email protected]

Config:

Sentry.config("https://[email protected]/210768").install();

I have following issue:

Description goes here ...

Steps to reproduce:

  • Step 1: Install Sentry by npm install react-native-sentry --save
  • Step 2: Link Sentry by react-native link react-native-sentry
  • Step 3: Execute Sentry.nativeCrash()

Actual result:

  • Nothing happen

Expected result:

  • The app should crash and report should send to Sentry

Most helpful comment

Not sure if this needs to be reopened, but I have run a release build of the app and still cannot get Sentry.nativeCrash() to crash the app. I do get a message when using

Sentry.captureMessage('NEW test message', {
    level: SentrySeverity.Warning,
})

All 6 comments

Would you be so kind and fill out the template you get when creating a new issue?
It's really hard for us to debug and reproduce a bug when we only get "it is not working" as a description.
I hope you understand that, thank you for helping us.

@HazAT I am sorry about that.

I have filled the template and hope you can help.

Thanks!

@booker-laputa Can you enable verbose logging and post the content, from startup until you pressed the button:

Sentry.config(
  'DSN',
  {
    logLevel: SentryLog.Verbose
  }
).install();

@HazAT I am experiencing the same problem, here is the content of the verbose log:

2017-09-15 10:11:25.383622+0500 <AppNAme>[592:143234] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
2017-09-15 10:11:25.817105+0500 <AppNAme>[592:143234] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2017-09-15 10:11:25.818213+0500 <AppNAme>[592:143234] [MC] Reading from public effective user settings.
2017-09-15 10:11:26.802742+0500 <AppNAme>[592:143272] Sentry Started -- Version: 3.6.0
    ************************ Crash Handler Notice ************************
    *     App is running in a debugger. Masking out unsafe monitors.     *
    * This means that most crashes WILL NOT BE RECORDED while debugging! *
    **********************************************************************
INFO : KSCrash.m (339): -[KSCrash sendAllReportsWithCompletion:]: Sending 0 crash reports
2017-09-15 10:11:26.893559+0500 <AppNAme>[592:143272] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17e5fec0>
2017-09-15 10:11:26.912281+0500 <AppNAme>[592:143272] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:26.916990+0500 <AppNAme>[592:143272] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452286.916753-0-BFE7F776-5696-48AA-803B-F70D64615793.json
2017-09-15 10:11:27.092820+0500 <AppNAme>[592:143279] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17da8760>
2017-09-15 10:11:27.104613+0500 <AppNAme>[592:143279] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:27.106074+0500 <AppNAme>[592:143279] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452287.105961-1-7EB0B30A-FD4F-4B30-9818-7801AB345168.json
2017-09-15 10:11:27.133098+0500 <AppNAme>[592:143279] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17eea850>
2017-09-15 10:11:27.160944+0500 <AppNAme>[592:143279] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:27.164015+0500 <AppNAme>[592:143279] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452287.163895-2-68FE37CF-36AA-41E2-A559-49940EA3929D.json
2017-09-15 10:11:27.225743+0500 <AppNAme>[592:143279] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17e4dcb0>
2017-09-15 10:11:27.238273+0500 <AppNAme>[592:143279] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:27.240014+0500 <AppNAme>[592:143279] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452287.239900-3-BD4C8430-CD41-422A-8E9A-31DBFE3E803F.json
2017-09-15 10:11:27.251584+0500 <AppNAme>[592:143279] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17d8dbe0>
2017-09-15 10:11:27.407972+0500 <AppNAme>[592:143234] token <bf8f4878 3a58fa57 52ffe75a 9d124192 45db68a2 3c4b1e66 36d2196f dee124eb>
2017-09-15 10:11:27.264680+0500 <AppNAme>[592:143279] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:27.441406+0500 <AppNAme>[592:143279] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452287.441277-4-1FEB01DA-AB35-4BC1-9CF2-E7FA43573D8B.json
2017-09-15 10:11:27.472375+0500 <AppNAme>[592:143279] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17dc5c70>
2017-09-15 10:11:27.483411+0500 <AppNAme>[592:143279] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:27.484901+0500 <AppNAme>[592:143279] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452287.484787-5-D274140F-12FA-48F6-854F-9F85F503DE7B.json
2017-09-15 10:11:28.847593+0500 <AppNAme>[592:143289] JPEGDecompressSurface : Picture decode failed: e00002d1
2017-09-15 10:11:28.976170+0500 <AppNAme>[592:143276] JPEGDecompressSurface : Picture decode failed: e00002d1
2017-09-15 10:11:31.118506+0500 <AppNAme>[592:143276] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17e35a30>
2017-09-15 10:11:31.130795+0500 <AppNAme>[592:143276] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:31.132266+0500 <AppNAme>[592:143276] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452291.132039-6-E5228FC0-88BA-43FE-BE3A-E31134E776DB.json
2017-09-15 10:11:31.191624+0500 <AppNAme>[592:143272] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17d81250>
2017-09-15 10:11:31.206880+0500 <AppNAme>[592:143272] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:31.208245+0500 <AppNAme>[592:143272] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452291.208134-7-40E7D560-7C2D-4EDC-82EB-E7117419A2B9.json
2017-09-15 10:11:31.255747+0500 <AppNAme>[592:143276] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17d15060>
2017-09-15 10:11:31.270985+0500 <AppNAme>[592:143276] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:31.274491+0500 <AppNAme>[592:143276] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452291.274390-8-8CEA3FA6-D49A-4386-81D2-261989F6A90A.json
2017-09-15 10:11:31.373654+0500 <AppNAme>[592:143276] JPEGDecompressSurface : Picture decode failed: e00002d1
2017-09-15 10:11:31.655949+0500 <AppNAme>[592:143272] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17eaf9b0>
2017-09-15 10:11:31.666821+0500 <AppNAme>[592:143272] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:31.675719+0500 <AppNAme>[592:143272] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452291.675211-9-081F1C1C-1826-4689-8D90-AC978E701B1F.json
2017-09-15 10:11:31.798482+0500 <AppNAme>[592:143289] Sentry - Debug:: Add breadcrumb: <SentryBreadcrumb: 0x17dce6f0>
2017-09-15 10:11:31.877394+0500 <AppNAme>[592:143289] Sentry - Debug:: Dropped first breadcrumb due limit
2017-09-15 10:11:31.878981+0500 <AppNAme>[592:143289] Sentry - Debug:: Writing to file: /var/mobile/Containers/Data/Application/1CA19726-CC61-4E58-97F9-26B6EB725E18/Library/Caches/io.sentry/breadcrumbs/1505452291.878843-10-A99EEEC5-B74D-404A-B484-FAFB14CF32C3.json
2017-09-15 10:11:31.939178+0500 <AppNAme>[592:143272] JPEGDecompressSurface : Picture decode failed: e00002d1
<AppNAme> was compiled with optimization - stepping may behave oddly; variables may not be available.

Just to clear things up, if you are running the app in DEBUG the app will not crash, only if it's running without a debugger attached.
Also notice, whenever the app crashes, reports will be sent on the next startup.
I am not able to reproduce this, the app crashes when calling Sentry.nativeCrash() when there is no debugger attached.

Not sure if this needs to be reopened, but I have run a release build of the app and still cannot get Sentry.nativeCrash() to crash the app. I do get a message when using

Sentry.captureMessage('NEW test message', {
    level: SentrySeverity.Warning,
})
Was this page helpful?
0 / 5 - 0 ratings