OneSignal / OneSignal-DotNet-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your .NET app with OneSignal. https://onesignal.com
MIT License
14 stars 4 forks source link

[Bug]: com.onesignal.common.events.EventProducer.fire #99

Open tobus2012 opened 2 months ago

tobus2012 commented 2 months ago

What happened?

java.util.ConcurrentModificationException

Steps to reproduce?

Sometimes on app start, sometimes on notification receive

What did you expect to happen?

Not crash the app

Relevant log output

Exception java.util.ConcurrentModificationException:
  at java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1029)
  at java.util.ArrayList$Itr.next (ArrayList.java:982)
  at com.onesignal.common.events.EventProducer.fire (EventProducer.kt:43)
  at com.onesignal.core.internal.application.impl.ApplicationService.setCurrent (ApplicationService.kt:50)
  at com.onesignal.core.internal.application.impl.ApplicationService.onActivityStarted (ApplicationService.kt:145)
  at android.app.Application.dispatchActivityStarted (Application.java:416)
  at android.app.Activity.dispatchActivityStarted (Activity.java:1505)
  at android.app.Activity.onStart (Activity.java:2039)
  at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1566)
  at android.app.Activity.performStart (Activity.java:8607)
  at android.app.ActivityThread.handleStartActivity (ActivityThread.java:3933)
  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence (TransactionExecutor.java:221)
  at android.app.servertransaction.TransactionExecutor.cycleToPath (TransactionExecutor.java:201)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:173)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2414)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:211)
  at android.os.Looper.loop (Looper.java:300)
  at android.app.ActivityThread.main (ActivityThread.java:8445)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:560)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:954)

Code of Conduct

jkasten2 commented 2 months ago

@tobus2012 This has been fixed, please update to Release 5.1.0 or newer.

tobus2012 commented 2 months ago

Note on Xamarin Forms

Xamarin Forms is no longer supported beyond version 5.0.2 of our .NET SDK. Microsoft has guides on migrating to Maui here, if needed.

version 5.1.0 works with xamarin.form? because 5.1.1 does not work

jkasten2 commented 2 months ago

@tobus2012 OneSignal stopped supporting Xamarin in the 5.1.0 release. We just update the release notes to make that more clear.

As you noted, Microsoft suggests migrating to .MAUI, as on May 1st 2024 Microsoft won't be making any more updates to Xamarin.

tobus2012 commented 2 months ago

@jkasten2 I get this error when I use version 5.1.0 Capture

jkasten2 commented 2 months ago

@tobus2012 What platform are you running when you hit this runtime error? Android, iOS, both?

tobus2012 commented 2 months ago

Android I have not tested on iOS, version 5.0.2 works very well on iOS except on some Android devices which returns the errors subject of this ticket