Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Messaging - "too many alarms" on Samsung's Android devices

We are using Firebase Messaging in Android app and since last week we reported many crashes from Samsung devices. The problem is not related with any of our classes. We are not using AlarmManager etc.

Here are the stacktraces:

1) Parcel.java

Fatal Exception: java.lang.SecurityException: !@Too many alarms (500) registered from pid 13776 uid 10011
   at android.os.Parcel.readException(Parcel.java:1540)
   at android.os.Parcel.readException(Parcel.java:1493)
   at android.app.IAlarmManager$Stub$Proxy.set(IAlarmManager.java:206)
   at android.app.AlarmManager.setImpl(AlarmManager.java:428)
   at android.app.AlarmManager.set(AlarmManager.java:215)
   at com.google.firebase.iid.FirebaseInstanceIdService.zzah(Unknown Source)
   at com.google.firebase.iid.FirebaseInstanceIdService.zzag(Unknown Source)
   at com.google.firebase.iid.FirebaseInstanceIdService.zzag(Unknown Source)
   at com.google.firebase.iid.FirebaseInstanceIdService.zzm(Unknown Source)
   at com.google.firebase.iid.zzb$2.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
   at java.lang.Thread.run(Thread.java:818)

2) In Binder.java

Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.net.conn.CONNECTIVITY_CHANGE flg=0x4000010 (has extras) } in com.google.firebase.iid.FirebaseInstanceIdService$1@12533ba
   at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:891)
   at android.os.Handler.handleCallback(Handler.java:746)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:148)
   at android.app.ActivityThread.main(ActivityThread.java:5443)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by java.lang.RuntimeException: Failure from system
   at android.app.ContextImpl.sendBroadcast(ContextImpl.java:772)
   at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:396)
   at com.google.firebase.iid.FirebaseInstanceIdService$1.onReceive(Unknown Source)
   at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:881)
   at android.os.Handler.handleCallback(Handler.java:746)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:148)
   at android.app.ActivityThread.main(ActivityThread.java:5443)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Caused by android.os.DeadObjectException
   at android.os.BinderProxy.transactNative(Binder.java)
   at android.os.BinderProxy.transact(Binder.java:503)
   at android.app.ActivityManagerProxy.broadcastIntent(ActivityManagerNative.java:3075)
   at android.app.ContextImpl.sendBroadcast(ContextImpl.java:767)
   at android.content.ContextWrapper.sendBroadcast(ContextWrapper.java:396)
   at com.google.firebase.iid.FirebaseInstanceIdService$1.onReceive(Unknown Source)
   at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:881)
   at android.os.Handler.handleCallback(Handler.java:746)
   at android.os.Handler.dispatchMessage(Handler.java:95)
   at android.os.Looper.loop(Looper.java:148)
   at android.app.ActivityThread.main(ActivityThread.java:5443)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)

Do you have similar problems? Do you know what could be a potential problem? I'm using [email protected]

like image 887
michalu Avatar asked Oct 17 '22 23:10

michalu


1 Answers

Good news! With the last update 10.0 the firebase team solved the problems with Too many alarms in Samsung devices, this is the patch note:

Fixed - An issue that caused extra alarms to be incorrectly set, resulting in crashes with Too Many Alarms in the stack trace on some Samsung devices.

Good programming!

like image 64
Merlí Escarpenter Pérez Avatar answered Oct 21 '22 05:10

Merlí Escarpenter Pérez