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

[Bug]: NullPointerException - Unable to stop activity #1748

Open
1 of 2 tasks
mannoeu opened this issue Oct 2, 2024 · 1 comment
Open
1 of 2 tasks

[Bug]: NullPointerException - Unable to stop activity #1748

mannoeu opened this issue Oct 2, 2024 · 1 comment

Comments

@mannoeu
Copy link

mannoeu commented Oct 2, 2024

What happened?

App crashes on android devices. iOS works fine.

Device: Samsumg Galaxy A10s (SM-A107M)
Android Version: 10
Free Memory: 502.1 MB
Free Disk: 4.4 GB

Versions

react-native: 0.73.4
react-native-onesignal: 5.1.3

Steps to reproduce?

I don't know how to reproduce. When I use the emulator or check using a signed apk via Browserstack nothing is reported.

What did you expect to happen?

It shouldn't cause error or work.

React Native OneSignal SDK version

react-native-onesignal version 5.1.3 use SDK version 5

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

java.lang.RuntimeException: Unable to stop activity {com.closeer.closeer_worker/com.closeer_worker.MainActivity}: java.lang.NullPointerException
        at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:5002)
        at android.app.ActivityThread.handleSleeping(ActivityThread.java:5131)
        at android.app.ActivityThread.access$2700(ActivityThread.java:272)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2153)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8019)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)

Caused by: java.lang.NullPointerException
        at com.onesignal.session.internal.session.impl.SessionService.getScheduleBackgroundRunIn(SessionService.kt:43)
        at com.onesignal.core.internal.background.impl.BackgroundManager.scheduleBackground(BackgroundManager.kt:95)
        at com.onesignal.core.internal.background.impl.BackgroundManager.onUnfocused(BackgroundManager.kt:87)
        at com.onesignal.core.internal.application.impl.ApplicationService$handleLostFocus$1.invoke(ApplicationService.kt:377)
        at com.onesignal.core.internal.application.impl.ApplicationService$handleLostFocus$1.invoke(ApplicationService.kt:377)
        at com.onesignal.common.events.EventProducer.fire(EventProducer.kt:50)
        at com.onesignal.core.internal.application.impl.ApplicationService.handleLostFocus(ApplicationService.kt:377)
        at com.onesignal.core.internal.application.impl.ApplicationService.onActivityStopped(ApplicationService.kt:198)
        at android.app.Application.dispatchActivityStopped(Application.java:515)
        at android.app.Activity.dispatchActivityStopped(Activity.java:1357)
        at android.app.Activity.onStop(Activity.java:2499)
        at androidx.fragment.app.FragmentActivity.onStop(FragmentActivity.java:520)
        at androidx.appcompat.app.AppCompatActivity.onStop(AppCompatActivity.java:257)
        at android.app.Instrumentation.callActivityOnStop(Instrumentation.java:1474)
        at android.app.Activity.performStop(Activity.java:8189)
        at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:4994)
        at android.app.ActivityThread.handleSleeping(ActivityThread.java:5131)
        at android.app.ActivityThread.access$2700(ActivityThread.java:272)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2153)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8019)
        at java.lang.reflect.Method.invoke(Method.java:-2)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)


### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
@mauripavan
Copy link

mauripavan commented Nov 4, 2024

@mannoeu Hi, having same issue captured by Sentry. Any updates?

react-native: 0.73.3
react-native-onesignal: 5.2.2

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

2 participants