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

Amazon (ADM) devices - Fatal Exception: java.lang.NullPointerException com.onesignal.OneSignalDbHelper.getInstance #1282

Closed
alekssunsss opened this issue Feb 18, 2021 · 9 comments · Fixed by #2018

Comments

@alekssunsss
Copy link

alekssunsss commented Feb 18, 2021

Description:

We do not how to reproduce the issue, but we have a lot of crashes in Crashlytics console. Seems like happens on Amazon devices only with android version 5.1.1.

Environment

  1. Android target SDK 29
  2. OneSignal sdk 4.0.0-4.1.0
  3. Devices are
    5.1.1 KFFOWI
    5.1.1 KFGIWI
    5.1.1 KFASWI
    5.1.1 KFARWI
    5.1.1 KFTBWI

Steps to Reproduce Issue:

  1. Looks like it happens when we send push notifications to our application users with OneSignal 4.1.0 integrated

Anything else:

(crash stacktraces, as well as any other information here)

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference

com.onesignal.OneSignalDbHelper.getInstance (OneSignalDbHelper.java:132)
com.onesignal.OneSignal.getDBHelperInstance (OneSignal.java:2999)
com.onesignal.OneSignal.isDuplicateNotification (OneSignal.java:2826)
com.onesignal.OneSignal.notValidOrDuplicated (OneSignal.java:2856)
com.onesignal.NotificationBundleProcessor.startNotificationProcessing (NotificationBundleProcessor.java:414)
com.onesignal.NotificationBundleProcessor.processBundleFromReceiver (NotificationBundleProcessor.java:380)
com.onesignal.ADMMessageHandler.onMessage (ADMMessageHandler.java:74)
com.amazon.device.messaging.ADMMessageHandlerBase.onHandleIntent (ADMMessageHandlerBase.java:85)
android.app.IntentService$ServiceHandler.handleMessage (IntentService.java:65)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.os.HandlerThread.run (HandlerThread.java:61)
@jkasten2
Copy link
Member

Thanks for reporting. I believe the issue has to do with OneSignal not calling OneSignal.initWithContext() internally in com.onesignal.ADMMessageHandler.onMessage and com.onesignal.ADMMessageHandlerJob.onMessage.

This is something that can be added to fix this issue and some integration tests implemented to prevent a regression in the future.

@alexeybaiburin
Copy link

@jkasten2 is there any updates about fixes for the issue posted above?

@ArsalImam
Copy link

ArsalImam commented May 22, 2021

Any update here, we are also facing the same issue?

1 similar comment
@Mrllopes
Copy link

Any update here, we are also facing the same issue?

@jacklj
Copy link

jacklj commented Mar 9, 2023

We're seeing this too, in latest OneSignal React Native. On all types of devices, not just Amazon

@theonetheycallneo
Copy link

theonetheycallneo commented Jul 19, 2023

We are seeing it too:

IMG_5726

@vlimag
Copy link

vlimag commented Aug 7, 2023

any luck on this one? also having this one coming on Sentry.

  • "react-native-onesignal": "4.5.1",
  • "react-native": "0.71.3",

@newme616
Copy link

me too!

"react-native-onesignal": "^4.5.1",

@jkasten2 jkasten2 changed the title Fatal Exception: java.lang.NullPointerException com.onesignal.OneSignalDbHelper.getInstance Amazon (ADM) devices - Fatal Exception: java.lang.NullPointerException com.onesignal.OneSignalDbHelper.getInstance Mar 28, 2024
@jkasten2
Copy link
Member

For those seeing this issue on Amazon devices this should now be fixed in 5.1.7.
If you continue to see a crash please open a new ticket, providing the new stacktrace.

If you see an issue sending Amazon notifications please see #1936 (comment)

We're seeing this too, in latest OneSignal React Native. On all types of devices, not just Amazon

@jacklj This issue thread is specific to Amazon devices, if you are seeing a similar issue please open a new issue, as the stacktrace will be different for non-Amazon devices.

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

Successfully merging a pull request may close this issue.

9 participants