Skip to content

[Bug]: High ANR Rate on Chinese Devices — NullPointerException in SessionService.getScheduleBackgroundRunIn() (v5.2.7) #1025

Open
@MontekristMedia

Description

@MontekristMedia

What happened?

We’re encountering a high rate of Application Not Responding (ANR) incidents linked to the OneSignal SDK, particularly on Chinese-manufactured devices such as Honor. These ANRs are critical and severely impacting user experience.

Environment:

SDK Version: OneSignal 5.2.7

Platform: Android

Devices: Primarily Chinese models (e.g. Honor Pad X9)

Frequency: ~99 ANRs per 1000 installs — extremely high

The crash seems to be caused by a NullPointerException in the SessionService.getScheduleBackgroundRunIn() method, suggesting a null reference during background scheduling.

We have seen reports of the same incident in OneSignal Android SDK Github Issue however your team claimed it to be solved in 5.1.25, it doesn't seem that way.

Steps to reproduce?

We are unable to reliably reproduce this locally, but crash reports from Google Play Console confirm the issue at scale.

What did you expect to happen?

No crashes for our users.

OneSignal Flutter SDK version

5.2.7

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

Exception java.lang.NullPointerException:
  at com.onesignal.session.internal.session.impl.SessionService.getScheduleBackgroundRunIn (SessionService.java:2)
  at com.onesignal.core.internal.background.impl.BackgroundManager.scheduleBackground (BackgroundManager.java:19)
  at com.onesignal.core.internal.background.impl.BackgroundManager.onUnfocused (BackgroundManager.java)
  at com.onesignal.core.internal.application.impl.ApplicationService$handleLostFocus$1.invoke (ApplicationService.java:5)
  at com.onesignal.core.internal.application.impl.ApplicationService$handleLostFocus$1.invoke (ApplicationService.java:2)
  at com.onesignal.common.events.EventProducer.fire (EventProducer.java:29)
  at com.onesignal.core.internal.application.impl.ApplicationService.handleLostFocus (ApplicationService.java:22)
  at com.onesignal.core.internal.application.impl.ApplicationService.onOrientationChanged (ApplicationService.java:44)
  ...

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions