Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant catch native errors in android in Debug mode #1102

Closed
1 task
sammysium opened this issue Sep 30, 2020 · 5 comments
Closed
1 task

Cant catch native errors in android in Debug mode #1102

sammysium opened this issue Sep 30, 2020 · 5 comments

Comments

@sammysium
Copy link

sammysium commented Sep 30, 2020

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

@jennmueng
Copy link
Member

Try removing the below snippet.

integrations: [
    new Sentry.BrowserIntegrations.GlobalHandlers({
      onerror: true,
      onunhandledrejection: true,
    }),
  ]

The default ReactNativeErrorHandlers integration already handles unhandled exceptions.

@sammysium
Copy link
Author

thanks @jennmueng . Even with that, I can't catch any hard errors from java and that is after the app is well started and catching javascript errors. OH well, I tried.

@sammysium
Copy link
Author

https://github.com/temharay/sentry is my repo.

@sammysium sammysium reopened this Oct 5, 2020
@sammysium sammysium changed the title Cant catch native errors in android Cant catch native errors in android in Debug mode Oct 5, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Nov 4, 2021

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@marandaneto
Copy link
Contributor

@sammysium please try the latest version of the Sentry RN SDK, many issues have been fixed since then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants