-
Notifications
You must be signed in to change notification settings - Fork 375
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]: NullPointerException on getPackageName() in OSUtils.getTargetSdkVersion #1516
Comments
Thank you for this information and steps to reproduce! We're investigating and will get back to you as soon as possible! |
is there any update on this issue @jennantilla ? |
this is happening to us, but on android 11
|
@jbrodriguez is there any solution to prevent this error ? |
@Shivemmer it seems sdk related, not sure it can be worked around, i opened another issue here #1534 |
@jennantilla Any update? |
Hi @jennantilla It seems like it's been a whole quarter and still no solution :( |
Hi @jennantilla |
Any update? We're also facing this issue. |
Hi @kyunkakata, Could you please post the patch? Considering the fact that there has been no response since May 17th, the official fix won't be coming anytime soon. |
Here is the pull request: OneSignal/OneSignal-Android-SDK#1848 |
Will this get patched? |
Same problem here. |
Recently I had an error with OneSignal, when my application had started it crashed because of OneSignal. My error was different, but it can help anyone. Error: My oneSignal version: react-native-onesignal": "^4.5.1" To resolve this error I needed update the version of OneSignal to version 5 and my app stop to crash. |
@jennantilla Can we possibly get an update on this? A pull request has been approved and merged into the SDK that is supposed to fix this issue but no activity on the React Native module yet. Our app is live but crashes for all of our users on newer versions of Android and there's nothing we can tell our users other than "a fix is coming" but our hands are tied until this module is updated. It's getting to the point now where our team is looking into alternatives to OneSignal :( |
We had the same problem and just applied react-native-permissions requestNotifications (it works the same, use it instead of one signal promptForPushNotificationsWithUserResponse), maybe you can do that workaround until they fix this, that has been active for a long time. |
This adjust was merged into the Android SDK, if I do a patch fix changing the version in build.gradle, should it resolve the issue? Is the react-native 4.5.2 library compatible with the android sdk com.onesignal:OneSignal:4.8.7? https://github.com/fxamauri/react-native-onesignal/blob/main/android/build.gradle#L32 |
Please upgrade to https://github.com/OneSignal/react-native-onesignal/releases/tag/4.5.3 which Uses Android SDK 4.8.7+ |
Hi, we have had no further reports of this. Please upgrade the OneSignal SDK if you or anyone is still having this issue. If this is still an issue, please open a new report with updated information. |
What happened?
In the react-native-onesignal package, we're encountering a java.lang.NullPointerException when calling android.content.Context.getPackageName() on a null object reference. The error specifically occurs at line 490 of OSUtils.java in the com.onesignal.OSUtils.getTargetSdkVersion method.
The stack trace indicates the error emerges when invoking the OneSignal.promptForPushNotifications method.
Stack trace:
its appears to happen only on Android 13 devices.
Steps to reproduce?
What did you expect to happen?
The application should not crash when OneSignal.promptForPushNotifications is invoked.
React Native OneSignal SDK version
4.5.0
Which platform(s) are affected?
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: