Unity-Technologies / com.unity.mobile.notifications

Mobile Notifications Package
https://docs.unity3d.com/Packages/com.unity.mobile.notifications@2.1/manual/index.html
Other
131 stars 42 forks source link

ANR: Broadcast of Intent #271

Closed ngolagani closed 1 year ago

ngolagani commented 1 year ago

We are on package version 2.1.1 and Unity version 2020.3.45f1, seeing the following ANRs related to Unity Notifications. These are the different kinds of ANRs seeing on our game.

unavailable - com.unity.androidnotifications.UnityNotificationUtilities.deserializeNotification
Broadcast of Intent { cmp=com.ea.tsb/com.unity.androidnotifications.UnityNotificationManager }
Native method - android.os.MessageQueue.nativePollOnce
Broadcast of Intent { cmp=com.ea.tsb/com.unity.androidnotifications.UnityNotificationManager }
android.app.Instrumentation.callApplicationOnCreate
Broadcast of Intent { cmp=com.ea.tsb/com.unity.androidnotifications.UnityNotificationManager }
Native method - java.lang.Thread.sleep
Broadcast of Intent { cmp=com.ea.tsb/com.unity.androidnotifications.UnityNotificationManager }
Native method - android.os.MessageQueue.nativePollOnce
Broadcast of Intent { act=android.intent.action.BOOT_COMPLETED cmp=com.ea.tsb/com.unity.androidnotifications.UnityNotificationRestartOnBootReceiver }
Native method - jdk.internal.misc.Unsafe.park
Broadcast of Intent { cmp=com.ea.tsb/com.unity.androidnotifications.UnityNotificationManager }
ngolagani commented 1 year ago

We are seeing it across all kind of devices and OS versions. And we don't have specific reproducible steps but looks like happening when we leave device ideal for some time.

aurimasc commented 1 year ago

Do you have more complete stack traces? In particular, the UnityNotificationUtilities.deserializeNotification seems to be the one that is causing the issue.

mariusJanke commented 1 year ago

We are also seeing the issue on a project. We are using Unity 2021.3.21f1, with the Package Version 2.1.1

Here is the full stack trace for the UnityNotificationUtilities.deserializeNotification:

at java.lang.Object.wait (Native method)
  at java.lang.Object.wait (Object.java:442)
  at java.lang.Object.wait (Object.java:568)
  at android.app.SharedPreferencesImpl.awaitLoadedLocked (SharedPreferencesImpl.java:279)
  at android.app.SharedPreferencesImpl.getString (SharedPreferencesImpl.java:301)
  at com.unity.androidnotifications.UnityNotificationUtilities.deserializeNotification (UnityNotificationUtilities.java:202)
  at com.unity.androidnotifications.UnityNotificationManager.getNotificationOrBuilderForIntent (UnityNotificationManager.java:873)
  at com.unity.androidnotifications.UnityNotificationManager.onReceive (UnityNotificationManager.java:664)
  at com.unity.androidnotifications.UnityNotificationManager.onReceive (UnityNotificationManager.java:651)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:4506)
  at android.app.ActivityThread.-$$Nest$mhandleReceiver (unavailable)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2240)
  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:8296)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:559)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:954)