Firebase cloud messagin causes ANR

1.4k Views Asked by At

I've an app in production with over 10k daily users
2% of the sessions are being reported as ANR due:

Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE flg=0x11000010 pkg=com.tomatedigital.app
cmp=com.tomatedigital.app/com.google.firebase.iid.FirebaseInstanceIdReceiver (has extras) }

I've checked many sources nobody come with a real solution for that.
this link: https://github.com/firebase/quickstart-android/issues/594 starts with a good talking but as always firebase boys "burn out" and stop answering.

all the reports show something like:

"main" tid=1 Native
"main" prio=5 tid=1 Native
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x73be7718 self=0xeeaf7000
  | sysTid=12027 nice=-4 cgrp=default sched=0/0 handle=0xf2fc54bc
  | state=S schedstat=( 1058569940 1464725264 2305 ) utm=68 stm=37 core=2 HZ=100
  | stack=0xff45f000-0xff461000 stackSize=8MB
  | held mutexes=
  #00  pc 000000000004a154  /system/lib/libc.so (__epoll_pwait+20)
  #01  pc 000000000001b799  /system/lib/libc.so (epoll_pwait+60)
  #02  pc 000000000001b7c9  /system/lib/libc.so (epoll_wait+12)
  #03  pc 0000000000010343  /system/lib/libutils.so (android::Looper::pollInner(int)+118)
  #04  pc 0000000000010235  /system/lib/libutils.so (android::Looper::pollOnce(int, int*, int*, void**)+32)
  #05  pc 00000000000e10ed  /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(_JNIEnv*, _jobject*, int)+24)
  #06  pc 00000000001a6aed  /system/framework/arm/boot-framework.oat (Java_android_os_MessageQueue_nativePollOnce__JI+92)
  at android.os.MessageQueue.nativePollOnce (MessageQueue.java)
  at android.os.MessageQueue.next (MessageQueue.java:325)
  at android.os.Looper.loop (Looper.java:142)
  at android.app.ActivityThread.main (ActivityThread.java:6942)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374)

I'm really not sure what to do to solve it.

These are my firebase imports

implementation 'com.google.firebase:firebase-storage:19.2.0'
implementation 'com.google.firebase:firebase-database:19.5.0'
implementation 'com.google.firebase:firebase-auth:19.4.0'
implementation 'com.google.firebase:firebase-dynamic-links:19.1.1'
implementation 'com.google.firebase:firebase-messaging:20.3.0'
implementation 'com.google.firebase:firebase-config:19.2.0'
0

There are 0 best solutions below