Skip to content

Cant catch native errors in android in Debug mode #1102

@sammysium

Description

@sammysium

OS:
Linux

Platform:
Android

SDK:
@sentry/react-native (>= 1.0.0)

SDK version: 1.8.2

react-native version: 0.63

sentry-cli 1.58.0

Are you using Expo?
no

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)

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://...@sentry.io/...'
  // other options
  enableAutoSessionTracking: true,
  enableNative: true,
  enableNativeCrashHandling: true,
  enabled: true,
  debug: true
});

I added the integrations to see if i get something.
or

(react-native-sentry)

Sentry.config(
  'https://...@sentry.io/...'
  // other options
 ).install();

Log

[Wed Sep 30 2020 13:59:40.750]  LOG      Sentry Logger [Log]: Integration installed: ReactNativeErrorHandlers
[Wed Sep 30 2020 13:59:40.752]  LOG      Sentry Logger [Log]: Integration installed: Release
[Wed Sep 30 2020 13:59:40.752]  LOG      Sentry Logger [Log]: Integration installed: InboundFilters
[Wed Sep 30 2020 13:59:40.753]  LOG      Sentry Logger [Log]: Integration installed: FunctionToString
[Wed Sep 30 2020 13:59:40.753]  LOG      Sentry Logger [Log]: Integration installed: Breadcrumbs
[Wed Sep 30 2020 13:59:40.754]  LOG      Sentry Logger [Log]: Integration installed: LinkedErrors
[Wed Sep 30 2020 13:59:40.754]  LOG      Sentry Logger [Log]: Integration installed: UserAgent
[Wed Sep 30 2020 13:59:40.755]  LOG      Sentry Logger [Log]: Integration installed: DebugSymbolicator
[Wed Sep 30 2020 13:59:40.755]  LOG      Sentry Logger [Log]: Integration installed: RewriteFrames
[Wed Sep 30 2020 13:59:40.756]  LOG      Sentry Logger [Log]: Integration installed: DeviceContext
[Wed Sep 30 2020 13:59:40.756]  LOG      Sentry Logger [Log]: Global Handler attached: onerror
[Wed Sep 30 2020 13:59:40.757]  LOG      Sentry Logger [Log]: Global Handler attached: onunhandledrejection
[Wed Sep 30 2020 13:59:40.757]  LOG      Sentry Logger [Log]: Integration installed: GlobalHandlers
[Wed Sep 30 2020 13:59:40.758]  LOG      Reactotron Configured
[Wed Sep 30 2020 13:59:40.760]  LOG      Running "fomobileapp" with {"rootTag":41}


I have following issue:

I am a little lost on native crushes. I am on emulator to begin with. Doing Sentry.nativeCrush() or nullVariable.toString() does catch the error.

But if i have an error in my java code (which are a bunch of functions written in Java), it is not captured.

It is not catching the issue on Debug mode though and works in Release mode well.

https://github.com/temharay/sentry

Steps to reproduce: Native
Create a ReactMethod decorated java function and simply throw an error: throw new Exception("Exception message");

Actual result:

Crush window

Expected result:

TO see the crush with stack trace in the dashboard.

git repo: https://github.com/temharay/sentry

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions