Skip to content

[Bug]: ANR during SDK Initialization #2226

@maximkir-fl

Description

@maximkir-fl

What happened?

My code follows the integration instructions and initializes the OneSignal SDK during Application.onCreate.
After upgrading to version 5.1.25, I saw the following ANR, originating from the initialization process.

main (runnable):tid=1 systid=22401 
at com.onesignal.common.events.EventProducer.access$getSubscribers$p(EventProducer.kt)
at com.onesignal.common.events.EventProducer.<init>(EventProducer.kt)
at com.onesignal.core.internal.application.impl.ApplicationService.<init>(ApplicationService.kt:31)
at java.lang.reflect.Constructor.newInstance0(Native method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at com.onesignal.common.services.ServiceRegistrationReflection.resolve(ServiceRegistration.kt:89)
at com.onesignal.common.services.ServiceProvider.getServiceOrNull(ServiceProvider.kt:79)
at com.onesignal.common.services.ServiceProvider.getService(ServiceProvider.kt:67)
at com.onesignal.common.services.ServiceProvider.getService$com_onesignal_core(ServiceProvider.kt:35)
at com.onesignal.internal.OneSignalImp.initWithContext(OneSignalImp.kt:203)
at com.onesignal.OneSignal.initWithContext(OneSignal.java:135)
at com.myapp.app.Application.onCreate(Application.kt:17)

Steps to reproduce?

1. Follow integration instructions and run the application

What did you expect to happen?

Smooth background initialization.

OneSignal Android SDK version

5.1.25

Android version

14

Specific Android models

No response

Relevant log output

No response

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions