firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.25k stars 572 forks source link

ANR Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE cmp=package_name/com.google.firebase.iid.FirebaseInstanceIdReceiver } #4894

Closed henryhong111 closed 9 months ago

henryhong111 commented 1 year ago

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

I getting too many ANR error

android.os.MessageQueue.nativePollOnce Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE cmp=com.hk.azal.live/com.google.firebase.iid.FirebaseInstanceIdReceiver }

Steps to reproduce:

What happened? How can we make the problem occur? This could be a description, log/console output, etc.

I'm not sure, no steps, only Google Console ,I saw a same issue, but it was closed #3990 I have updated firebase-messaging to 23.1.0, but it still has no effect

"main" tid=1 Native

00 pc 0x00000000000dea18 /apex/com.android.runtime/lib64/bionic/libc.so (__epoll_pwait+8)

01 pc 0x000000000001a1f4 /system/lib64/libutils.so (android::Looper::pollInner(int)+180)

02 pc 0x000000000001a0d8 /system/lib64/libutils.so (android::Looper::pollOnce(int, int, int, void**)+112)

03 pc 0x000000000011ae5c /system/lib64/libandroid_runtime.so (android::android_os_MessageQueue_nativePollOnce(_JNIEnv, _jobject, long, int)+44)

at android.os.MessageQueue.nativePollOnce (Native method) at android.os.MessageQueue.next (MessageQueue.java:335) at android.os.Looper.loop (Looper.java:206) at android.app.ActivityThread.main (ActivityThread.java:8653) at java.lang.reflect.Method.invoke (Native method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130)

"Signal Catcher" tid=2 Runnable

00 pc 0x0000000000483028 /apex/com.android.art/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits >&, int, BacktraceMap, char const, art::ArtMethod, void, bool)+140)

01 pc 0x0000000000588888 /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits >&, bool, BacktraceMap*, bool) const+380)

02 pc 0x00000000005a56d4 /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+924)

03 pc 0x000000000059f078 /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure, art::Closure)+536)

04 pc 0x000000000059e134 /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits >&, bool)+1928)

05 pc 0x000000000059d5cc /apex/com.android.art/lib64/libart.so (art::ThreadList::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits >&)+776)

06 pc 0x000000000054ae40 /apex/com.android.art/lib64/libart.so (art::Runtime::DumpForSigQuit(std::__1::basic_ostream<char, std::__1::char_traits >&)+196)

07 pc 0x000000000056099c /apex/com.android.art/lib64/libart.so (art::SignalCatcher::HandleSigQuit()+1400)

08 pc 0x000000000055f950 /apex/com.android.art/lib64/libart.so (art::SignalCatcher::Run(void*)+384)

09 pc 0x00000000000f40c4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)

10 pc 0x000000000008ed10 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"Jit thread pool worker thread 0" tid=7 Native

00 pc 0x0000000000089c8c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)

01 pc 0x000000000019fd34 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)

02 pc 0x00000000005a7350 /apex/com.android.art/lib64/libart.so (art::ThreadPool::GetTask(art::Thread*)+120)

03 pc 0x00000000005a66e4 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Run()+144)

04 pc 0x00000000005a6190 /apex/com.android.art/lib64/libart.so (art::ThreadPoolWorker::Callback(void*)+192)

05 pc 0x00000000000f40c4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)

06 pc 0x000000000008ed10 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"HeapTaskDaemon" tid=8 Waiting

00 pc 0x0000000000089c90 /apex/com.android.runtime/lib64/bionic/libc.so (syscall+32)

01 pc 0x00000000001a0104 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::TimedWait(art::Thread*, long, int)+172)

02 pc 0x00000000002d859c /apex/com.android.art/lib64/libart.so (art::gc::TaskProcessor::GetTask(art::Thread*)+516)

03 pc 0x00000000002d8ed8 /apex/com.android.art/lib64/libart.so (art::gc::TaskProcessor::RunAllTasks(art::Thread*)+92)

at dalvik.system.VMRuntime.runHeapTasks (Native method) at java.lang.Daemons$HeapTaskDaemon.runInternal (Daemons.java:531) at java.lang.Daemons$Daemon.run (Daemons.java:139) at java.lang.Thread.run (Thread.java:923)

"ReferenceQueueDaemon" tid=9 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:442) at java.lang.Object.wait (Object.java:568) at java.lang.Daemons$ReferenceQueueDaemon.runInternal (Daemons.java:217) at java.lang.Daemons$Daemon.run (Daemons.java:139) at java.lang.Thread.run (Thread.java:923)

"FinalizerDaemon" tid=10 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:442) at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:190) at java.lang.ref.ReferenceQueue.remove (ReferenceQueue.java:211) at java.lang.Daemons$FinalizerDaemon.runInternal (Daemons.java:273) at java.lang.Daemons$Daemon.run (Daemons.java:139) at java.lang.Thread.run (Thread.java:923)

"FinalizerWatchdogDaemon" tid=11 Timed Waiting at java.lang.Thread.sleep (Native method) at java.lang.Thread.sleep (Thread.java:442) at java.lang.Thread.sleep (Thread.java:358) at java.lang.Daemons$FinalizerWatchdogDaemon.sleepForNanos (Daemons.java:390) at java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization (Daemons.java:419) at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal (Daemons.java:325) at java.lang.Daemons$Daemon.run (Daemons.java:139) at java.lang.Thread.run (Thread.java:923)

"Binder:16558_1" tid=12 Native

00 pc 0x00000000000dda54 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)

01 pc 0x0000000000097034 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)

02 pc 0x0000000000053420 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+248)

03 pc 0x00000000000536f8 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)

04 pc 0x000000000005431c /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+72)

05 pc 0x000000000007cde0 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+400)

06 pc 0x000000000001553c /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+320)

07 pc 0x00000000000a4974 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144)

08 pc 0x0000000000014db0 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+408)

09 pc 0x00000000000f40c4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)

10 pc 0x000000000008ed10 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"Binder:16558_2" tid=13 Native

00 pc 0x00000000000dda54 /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+4)

01 pc 0x0000000000097034 /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)

02 pc 0x0000000000053420 /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver(bool)+248)

03 pc 0x00000000000536f8 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+24)

04 pc 0x0000000000054348 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+116)

05 pc 0x000000000007cde0 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+400)

06 pc 0x000000000001553c /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+320)

07 pc 0x00000000000a4974 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144)

08 pc 0x0000000000014db0 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+408)

09 pc 0x00000000000f40c4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)

10 pc 0x000000000008ed10 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"Binder:16558_3" tid=14 Native

00 pc 0x0000000000089c8c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)

01 pc 0x000000000019fd34 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)

02 pc 0x000000000038dfcc /apex/com.android.art/lib64/libart.so (art::JNI::CallBooleanMethodV(_JNIEnv, _jobject, _jmethodID*, std::__va_list)+504)

03 pc 0x000000000009eaa8 /system/lib64/libandroid_runtime.so (_JNIEnv::CallBooleanMethod(_jobject, _jmethodID, ...)+124)

04 pc 0x000000000012cef4 /system/lib64/libandroid_runtime.so (JavaBBinder::onTransact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+160)

05 pc 0x000000000004a834 /system/lib64/libbinder.so (android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+232)

06 pc 0x0000000000053af8 /system/lib64/libbinder.so (android::IPCThreadState::executeCommand(int)+700)

07 pc 0x0000000000053780 /system/lib64/libbinder.so (android::IPCThreadState::getAndExecuteCommand()+160)

08 pc 0x0000000000054348 /system/lib64/libbinder.so (android::IPCThreadState::joinThreadPool(bool)+116)

09 pc 0x000000000007cde0 /system/lib64/libbinder.so (android::PoolThread::threadLoop()+400)

10 pc 0x000000000001553c /system/lib64/libutils.so (android::Thread::_threadLoop(void*)+320)

11 pc 0x00000000000a4974 /system/lib64/libandroid_runtime.so (android::AndroidRuntime::javaThreadShell(void*)+144)

12 pc 0x0000000000014db0 /system/lib64/libutils.so (thread_data_t::trampoline(thread_data_t const*)+408)

13 pc 0x00000000000f40c4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)

14 pc 0x000000000008ed10 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"Profile Saver" tid=15 Native

00 pc 0x0000000000089c8c /apex/com.android.runtime/lib64/bionic/libc.so (syscall+28)

01 pc 0x000000000019fd34 /apex/com.android.art/lib64/libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*)+148)

02 pc 0x0000000000341d9c /apex/com.android.art/lib64/libart.so (art::ProfileSaver::Run()+484)

03 pc 0x000000000034644c /apex/com.android.art/lib64/libart.so (art::ProfileSaver::RunProfileSaverThread(void*)+180)

04 pc 0x00000000000f40c4 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+64)

05 pc 0x000000000008ed10 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)

"Timer-0" tid=16 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:442) at java.lang.Object.wait (Object.java:568) at java.util.TimerThread.mainLoop (Timer.java:533) at java.util.TimerThread.run (Timer.java:512)

"cached-pool-1-thread-0" tid=17 Timed Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:2109) at java.util.concurrent.LinkedBlockingQueue.poll (LinkedBlockingQueue.java:467) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1091) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923) at com.blankj.utilcode.util.ThreadUtils$UtilsThreadFactory$1.run (ThreadUtils.java)

"ScionFrontendApi" tid=18 Timed Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:2109) at java.util.concurrent.LinkedBlockingQueue.poll (LinkedBlockingQueue.java:467) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1091) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923)

"GmsDynamite" tid=19 Waiting at java.lang.Object.wait (Native method) at java.lang.Object.wait (Object.java:442) at java.lang.Object.wait (Object.java:568) at com.google.android.gms.dynamite.zza.run (com.google.android.gms:play-services-basement@@18.1.0:2)

"Crashlytics Exception Handler1" tid=20 Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun (ExecutorUtils.java) at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run (BackgroundPriorityRunnable.java:27) at java.lang.Thread.run (Thread.java:923)

"com.google.firebase.crashlytics.startup1" tid=21 Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun (ExecutorUtils.java) at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run (BackgroundPriorityRunnable.java:27) at java.lang.Thread.run (Thread.java:923)

"firebase-installations-executor-١" tid=22 Timed Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:2109) at java.util.concurrent.LinkedBlockingQueue.poll (LinkedBlockingQueue.java:467) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1091) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at java.lang.Thread.run (Thread.java:923)

"awaitEvenIfOnMainThread task continuation executor1" tid=23 Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.park (LockSupport.java:190) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await (AbstractQueuedSynchronizer.java:2067) at java.util.concurrent.LinkedBlockingQueue.take (LinkedBlockingQueue.java:442) at java.util.concurrent.ThreadPoolExecutor.getTask (ThreadPoolExecutor.java:1092) at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152) at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun (ExecutorUtils.java) at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run (BackgroundPriorityRunnable.java:27) at java.lang.Thread.run (Thread.java:923)

"firebase-installations-executor-٢" tid=24 Timed Waiting at sun.misc.Unsafe.park (Native method) at java.util.concurrent.locks.LockSupport.parkNanos (LockSupport.java:230) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos (AbstractQueuedSynchronizer.java:2109)

Relevant Code:

// TODO(you): code here to reproduce the problem
google-oss-bot commented 1 year ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

argzdev commented 1 year ago

Thanks for reaching out, @henryhong111. Could you answer a few questions for me below:

  1. Do you have any code snippets you can share with us related to firebase-messaging?
  2. Are you running any heavy processing codes in the Application class, specifically in the onCreate? If so, could you try moving it to different parts of your app and see if that works?
  3. Could you try firebase-messaging version 23.1.1, according to the release notes, there was a fix regarding ANRs on that version.

Let me know if any of these help, thanks!

henryhong111 commented 1 year ago

Thanks for reaching out, @henryhong111. Could you answer a few questions for me below:

  1. Do you have any code snippets you can share with us related to firebase-messaging?
  2. Are you running any heavy processing codes in the Application class, specifically in the onCreate? If so, could you try moving it to different parts of your app and see if that works?
  3. Could you try firebase-messaging version 23.1.1, according to the release notes, there was a fix regarding ANRs on that version.

Let me know if any of these help, thanks! 1.This is my code in MainActivity

 private void initFCM() {
        if (noticeOpen) {
            FirebaseMessaging.getInstance().getToken().addOnCompleteListener(task -> {
                if (!task.isSuccessful()) {
                    Log.w(TAG, "Fetching FCM registration token failed", task.getException());
                    return;
                }
                // Get new FCM registration token
                String token = task.getResult();
                updateFCMToken(token);
            });

            FirebaseMessaging.getInstance().subscribeToTopic("XXXX").addOnCompleteListener(task -> Log.d(TAG, task.isSuccessful() ? "Subscribed" : "Subscribe failed"));
        }
    }

In service


override fun onMessageReceived(message: RemoteMessage) {

        message.notification?.body?.let { body ->
            PushManager.instance.sendNotification(
                this,
                body,
                message.notification?.title,
                message.notification?.imageUrl?.toString()
            )
        }
    }

2.In the onCreate method of the application, I moved heavy tasks to a sub-thread, but it still has no effect. 3.I will try using firebase-messaging version 23.1.1 in the next release, but I am not sure if it will work.

YuTianTina commented 1 year ago

I have same ANR on firebase-messaging:23.0.5

Bodrihin commented 1 year ago

I have same ANR. Installed firebase for unity: 10.7.0

Native method - android.os.MessageQueue.nativePollOnce Broadcast of Intent { act=com.google.android.c2dm.intent.RECEIVE cmp=com.bfa.battlelines/com.google.firebase.iid.FirebaseInstanceIdReceiver }

argzdev commented 1 year ago

Thanks for confirming, @henryhong111. The fix regarding firebase-messaging version 23.1.1 is with dealing of handling simultaneous messages. Do you perhaps have multiple campaigns setup?

Hi @YuTianTina, please try upgrading to the latest version 23.1.2 and see if that helps.

Hi @Bodrihin, was this issue not present in the previous version of Firebase Unity?

Bodrihin commented 1 year ago

Hi @Bodrihin, was this issue not present in the previous version of Firebase Unity?

yes, the previous one too

henryhong111 commented 1 year ago

Thanks for confirming, @henryhong111. The fix regarding firebase-messaging version 23.1.1 is with dealing of handling simultaneous messages. Do you perhaps have multiple campaigns setup?

Sorry, I can't understand your question. Could you describe it in detail?

argzdev commented 1 year ago

Hi @henryhong111, sorry for the confusion. What I meant is do you have many campaigns setup in your Firebase Console dashboard? I think the issue might be due to your campaigns sending out a lot notifications all at once which is causing the issue. However, the update in 23.1.1 should fix this issue. Let me know if updating to that version or a higher version fixes the issue. Thanks.

google-oss-bot commented 1 year ago

Hey @henryhong111. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@henryhong111 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

YuTianTina commented 1 year ago

Thanks for confirming, @henryhong111. The fix regarding firebase-messaging version 23.1.1 is with dealing of handling simultaneous messages. Do you perhaps have multiple campaigns setup?

Hi @YuTianTina, please try upgrading to the latest version 23.1.2 and see if that helps.

Hi @Bodrihin, was this issue not present in the previous version of Firebase Unity?

@argzdev it still not work on '23.1.2', the ANR is still exist

henryhong111 commented 1 year ago

Maybe we need to re-open this issue

google-oss-bot commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@henryhong111 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

gsakakihara commented 1 year ago

@henryhong111

Is that the complete list of threads during the ANR? I noticed that there don't appear to be any Firebase Messaging threads, which may mean that this is happening before FirebaseMessaging is being initialized. This usually means that the app is not getting to handling the the message broadcast before the ANR timeout. Some issues we have seen are when the app is taking too long during initialization or if the main thread is being occupied by other operations so the broadcast can't be delivered to the receiver until too late.

its-Chiedu commented 1 year ago

An option to send a bugreport would solve this in no time.

argzdev commented 1 year ago

Hi @its-Chiedu, that sounds interesting. Can you explain this further how you would like it to work?

radityagumay commented 11 months ago

i have the same ANR in the com.google.firebase:firebase-bom:30.5.0

gsakakihara commented 9 months ago

@radityagumay Do you have the same stack traces as the original issue?

If so, have you looked at https://github.com/firebase/firebase-android-sdk/issues/4894#issuecomment-1601519421? Have you looked into whether your app is taking a long time to initialize (particularly on low end devices where things like file operations may take much longer than expected) or whether the main/UI thread could have too many operations scheduled, so the app doesn't get to handling the broadcast until after the ANR timer has expired?

If not, could you open a separate issue with the new stack traces?

google-oss-bot commented 9 months ago

Hey @henryhong111. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

its-Chiedu commented 9 months ago

Hi @its-Chiedu, that sounds interesting. Can you explain this further how you would like it to work?

I think this might be impossible - I haven't found a way to programmatically send a bug report and not sure if the tombstone is reachable in order to send it on restart.

google-oss-bot commented 9 months ago

Hey @henryhong111. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 9 months ago

Since there haven't been any recent updates here, I am going to close this issue.

@henryhong111 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.