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

Android App Crashes #187

Open
suryapermana92work opened this issue Jan 17, 2024 · 7 comments
Open

Android App Crashes #187

suryapermana92work opened this issue Jan 17, 2024 · 7 comments

Comments

@suryapermana92work
Copy link

suryapermana92work commented Jan 17, 2024

I am getting app crashes while in App.js, instantiating a Rollbar Client

Steps to reproduce
"react": "18.2.0",
"react-native": "0.71.4",
"rollbar": "^2.26.2",
"rollbar-react-native": "^1.0.0-beta.2"

Platforms
Android

JavaScript runtime
Hermes

Workflow
React Native (without Expo)

Build type
Release mode

Device
Real device

import { Client } from 'rollbar-react-native'

const rollbar = new Client({
  accessToken: "POST_CLIENT_ITEM_ACCESS_TOKEN",
  captureUncaught: true,
  captureUnhandledRejections: true
})
@waltjones
Copy link
Contributor

@suryapermana92work thank you for the report. Can you include details of the crash?

@suryapermana92work
Copy link
Author

Screenshot_1705505587

@suryapermana92work
Copy link
Author

@suryapermana92work thank you for the report. Can you include details of the crash?

@waltjones pls let me know if you need any more info

@gsonego
Copy link

gsonego commented Feb 10, 2024

Hi, I'm also facing similar issue..
I've used the rollbar react-native SDK but also the react SDK and both are failing.
The app crashes when trying to send any info to Rollbar.

It works fine on Expo Go, Android Simulator and also web version, but crashes on Android real device.

image

@jfbaraky
Copy link

jfbaraky commented Oct 8, 2024

Having the same issue here after updated to 1.0.0-beta.4
0.9.3 was working normally, but it's not working with the new iOS version :/

@aaronabf
Copy link

aaronabf commented Dec 9, 2024

Any updates on this?

@waltjones
Copy link
Contributor

Hi all,

I have tested here with a hardware Pixel device, and do not get this error. The error looks like the Rollbar Android SDK was not initialized. This is necessary for any project that loads the Java/Android code for rollbar-react-native. It should not be necessary for JS-only projects such as un-ejected Expo projects.

The doc for this is here:
https://docs.rollbar.com/docs/react-native#android

The specific execution that leads to the error is here:
https://github.com/rollbar/rollbar-react-native/blob/master/src/Client.js#L15-L17

That init will be called if React Native's NativeModules returns anything for RollbarReactNative.

If this error is occurring and the init in onCreate is present, it must be executing after the Javascript init. If that matches what anyone is seeing, let me know.

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

5 participants