OneSignal-Android-SDK
OneSignal-Android-SDK copied to clipboard
Fatal Exception: java.lang.NullPointerException com.onesignal.OneSignalDbHelper.getInstance
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
- Android target SDK 29
- OneSignal sdk 4.0.0-4.1.0
- 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:
- 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)
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.
@jkasten2 is there any updates about fixes for the issue posted above?
Any update here, we are also facing the same issue?
Any update here, we are also facing the same issue?
We're seeing this too, in latest OneSignal React Native. On all types of devices, not just Amazon
We are seeing it too:
any luck on this one? also having this one coming on Sentry.
- "react-native-onesignal": "4.5.1",
- "react-native": "0.71.3",
me too!
"react-native-onesignal": "^4.5.1",
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 https://github.com/OneSignal/OneSignal-Android-SDK/issues/1936#issuecomment-2024161687
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.