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]: Android Crash at version 5.1.0 Unable to start receiver #847

Closed
2 of 3 tasks
burakcbdn opened this issue Feb 26, 2024 · 1 comment
Closed
2 of 3 tasks

[Bug]: Android Crash at version 5.1.0 Unable to start receiver #847

burakcbdn opened this issue Feb 26, 2024 · 1 comment

Comments

@burakcbdn
Copy link

burakcbdn commented Feb 26, 2024

What happened?

After upgrading to the latest version our app recorded "Crashes" with following errors

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.onesignal.notifications.receivers.NotificationDismissReceiver: java.lang.reflect.InvocationTargetException at android.app.ActivityThread.handleReceiver(ActivityThread.java:4619) at android.app.ActivityThread.access$1900(ActivityThread.java:284) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2277) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:233) at android.os.Looper.loop(Looper.java:334) at android.app.ActivityThread.main(ActivityThread.java:8333) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)

 `Caused by java.lang.reflect.InvocationTargetException:
   at java.lang.reflect.Constructor.newInstance0(Constructor.java)
   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.internal.OneSignalImp.initWithContext(OneSignalImp.kt:472)
   at com.onesignal.OneSignal.initWithContext(OneSignal.kt:208)
   at com.onesignal.notifications.receivers.NotificationDismissReceiver.onReceive(NotificationDismissReceiver.kt:39)
   at android.app.ActivityThread.handleReceiver(ActivityThread.java:4610)
   at android.app.ActivityThread.access$1900(ActivityThread.java:284)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2277)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loopOnce(Looper.java:233)
   at android.os.Looper.loop(Looper.java:334)
   at android.app.ActivityThread.main(ActivityThread.java:8333)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)`
   
   `Caused by java.lang.NullPointerException:
   at com.onesignal.core.internal.application.impl.ApplicationService.getAppContext(ApplicationService.kt:39)
   at com.onesignal.core.internal.preferences.impl.PreferencesService.getSharedPrefsByName(PreferencesService.kt:234)
   at com.onesignal.core.internal.preferences.impl.PreferencesService.get(PreferencesService.kt:134)
   at com.onesignal.core.internal.preferences.impl.PreferencesService.getString(PreferencesService.kt:42)
   at com.onesignal.common.modeling.ModelStore.load(ModelStore.kt:165)
   at com.onesignal.common.modeling.SimpleModelStore.<init>(SimpleModelStore.kt:23)
   at com.onesignal.core.internal.config.ConfigModelStore.<init>(ConfigModelStore.kt:8)
   at java.lang.reflect.Constructor.newInstance0(Constructor.java)
   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.internal.OneSignalImp.initWithContext(OneSignalImp.kt:472)
   at com.onesignal.OneSignal.initWithContext(OneSignal.kt:208)
   at com.onesignal.notifications.receivers.NotificationDismissReceiver.onReceive(NotificationDismissReceiver.kt:39)
   at android.app.ActivityThread.handleReceiver(ActivityThread.java:4610)
   at android.app.ActivityThread.access$1900(ActivityThread.java:284)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2277)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loopOnce(Looper.java:233)
   at android.os.Looper.loop(Looper.java:334)
   at android.app.ActivityThread.main(ActivityThread.java:8333)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)`

Steps to reproduce?

1. Install version 5.1.0
2. Run the app

What did you expect to happen?

Expect app to launch without crash

OneSignal Flutter SDK version

Release 5.1.0

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jkasten2
Copy link
Member

@burakcbdn I believe this should be fixed with Release 5.1.2. Let us know if it fixes the issue for you! If not please provide the new stacktrace

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