-
Notifications
You must be signed in to change notification settings - Fork 377
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
[Bug]: NullPointer on initWithContext on Android #1587
Comments
any short term workaround for this? |
@arthurgeron-work Are you able to reproduce this issue on SDK 5.0.2? |
Only some employees have Androids that reproduce this crash, I've built a version with 5.0.2 and asked them to test it, though here it's a national holiday today we might only get a reply Friday, I'll post here as soon as I get some feedback. |
I've confirmed that the issue persists on SDK 5.0.2. |
Thank you for your reply. I am not sure if the issue is related to those others since those are not null pointer exceptions.
I am investigating which of these issues it is. |
@arthurgeron-work If you are able to get verbose logs when reproducing the crash that would be helpful! In particular I would like to know if |
@emawby Thank you for looking into this, unfortunately this exception is hard to reproduce locally I've found some related failure/error, here's the stacktrace:
No logs about ApplicationService.init. |
@arthurgeron-work When/where do you initialize OneSignal in the lifecycle of your application? Also I am seeing that the stacktrace has |
I followed the native's SDK android setup documentation, which instructs to manually place "initWithContext" inside I'm also initializing it in JS (only once per app execution), as instructed to by the docs. It functions normally for most devices, there's a very low percentage ( e.g. Moto G) which are reporting those exceptions to Android Vitals |
I see. You do not need to follow the android native setup and I am thinking that it might be causing the issue. The react-native initialize alone is sufficient! |
Hello, it states https://documentation.onesignal.com/docs/react-native-sdk-setup here in Android devices, that you should follow android sdk setup steps. What is true? |
Hello @arthurgeron-work. Any progress with this one? Workaround maybe? |
I had to:
I believe the latter will help with this specific bug, but many others were recently fixed in a recent OneSignal's Android SDK update. So you might just need to test it again. |
We have updated the react native setup instructions to only keep any Android instructions that are still relevant. Please let us know if this issue reported still occurs. |
I am investigating reports of this crash from other users still reporting this happening.
Can you explain more about what you did here? |
Sure! It seems there was some confusion in the documentation, which is now fixed. Before it'd suggest initializing both natively on Android's "onCreate" with initWithContext(not sure why I said JS context before) as well from react-native. Turns out the correct way is to only initialize it in React Native once, anything else would cause issues. |
Thank you @arthurgeron-work |
This issue is happening in native android as well. I have updated to the latest version of the SDK and the issue still isn't resolved. Please find the stack trace below. It seems to be ranging on different devices with different Android OS versions, however it's saying that 93% are in background state.
Crashing in this line of code called from the Application's onCreate function
|
Hi @emawby @arthurgeron-work guys I am also getting this crash and I am not getting it only in "MOTO G" devices. I guess it persist almost in all android devices. Everything is working fine in development debug build. But when I am creating release .apk then I am getting this crash on app start in real devices as well as in android emulators (virtual devices). I am looking forward to get help on this. I am using latest version 5.0.6 of your lib.
|
Release 5.1.0 has a fix in it's included OneSignal-Android-SDK 5.1.6 that addresses this issue. Please update and let us know if it solves the issue for you. Please provide the new stack trace if it does not. |
Hi @jkasten2 thanks for your reply. I tried to upgrade my version from Here are the logs
|
Anyone faced this issue or able to fixed that? |
This issue seems to be resolved with the latest version from my end. |
@chriscborg I tried but it doesn't helps me |
Same issue on 5.1.6 |
Hello everyone--since the last activity in this issue, we have made several improvements to our SDK. Please update to the latest version and let us know if you are still experiencing this problem. Thank you! |
What happened?
Some users are experiencing crashes right after splash screen; Android's diagnostics are pointing to oneSignal
Steps to reproduce?
What did you expect to happen?
Should not Crash
React Native OneSignal SDK version
Release 5
Which platform(s) are affected?
Relevant log output
Second stacktrace:
The text was updated successfully, but these errors were encountered: