You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are experiencing an Application Not Responding (ANR) issue in our Android application, with logs indicating prolonged blocking in the native call to android.os.MessageQueue.nativePollOnce. Analysis of the stack trace from Firebase Crashlytics shows that several threads—including the main thread, Unity-related threads, and various background service threads—are consistently entering native wait states.
Key Details from the Log File:
• Main Thread Blockage:
The primary stack trace indicates that the main thread is halted within android.os.MessageQueue.nativePollOnce, cascading into calls such as Looper.loop and ActivityThread.main. This blockage directly contributes to UI freezes.
• Unity Integration Impact:
Logs reveal that Unity-specific threads, such as “UnityMain,” are similarly affected. These threads show multiple wait states in native calls, suggesting that background processing related to Unity might be intermingling with the issue.
• Multiple Background Threads Affected:
Other threads—including those associated with system services and background tasks (e.g., “InsetsAnimations”, “AssetPackService”, “ConnectivityThread”, “GoogleApiHandler”)—are seen waiting on native polling or further operations. This systemic blockage hints at an underlying issue in the message queue handling.
• Suspected Firebase Cloud Messaging Cause:
Further investigation into the context of the logs has led us to suspect that Firebase Cloud Messaging (FCM) is triggering this ANR. It appears that when FCM processes and delivers messages, it may be causing delays or interfering with the normal operation of the message queue. This interference could be compounding the thread blockage observed across both UI and background processing threads.
Impact:
User Experience: The ANR results in significant UI freezes, negatively affecting overall user engagement.
System Stability: The involvement of multiple threads—including those related to Unity and background services—indicates that FCM-related processing might be creating a broader contention issue within our application's message handling system.
Request for Investigation:
Examine recent changes in our Firebase Cloud Messaging integration to determine if they might be affecting message queue processing.
Investigate potential thread contention or synchronization issues triggered by FCM callbacks that lead to prolonged blocking in nativePollOnce.
Explore possible mitigations or workarounds to prevent FCM from causing message queue congestion, particularly in environments that combine Unity and native Android components.
main (native):tid=1 systid=12579
#00 pc 0x9ca68 libc.so (__epoll_pwait + 8)#01 pc 0x19d88 libutils.so (android::Looper::pollInner(int) + 184)#02 pc 0x19c68 libutils.so (android::Looper::pollOnce(int, int*, int*, void**) + 112)#03 pc 0x11232c 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:183)
at android.app.ActivityThread.main(ActivityThread.java:7785)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
If using CocoaPods for Apple platforms, the project's Podfile.lock
Expand Podfile.lock snippet
👀 Replace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered:
Description
We are experiencing an Application Not Responding (ANR) issue in our Android application, with logs indicating prolonged blocking in the native call to
android.os.MessageQueue.nativePollOnce
. Analysis of the stack trace from Firebase Crashlytics shows that several threads—including the main thread, Unity-related threads, and various background service threads—are consistently entering native wait states.Key Details from the Log File:
• Main Thread Blockage:
The primary stack trace indicates that the main thread is halted within
android.os.MessageQueue.nativePollOnce
, cascading into calls such asLooper.loop
andActivityThread.main
. This blockage directly contributes to UI freezes.• Unity Integration Impact:
Logs reveal that Unity-specific threads, such as
“UnityMain,”
are similarly affected. These threads show multiple wait states in native calls, suggesting that background processing related to Unity might be intermingling with the issue.• Multiple Background Threads Affected:
Other threads—including those associated with system services and background tasks (e.g., “
InsetsAnimations
”, “AssetPackService
”, “ConnectivityThread
”, “GoogleApiHandler
”)—are seen waiting on native polling or further operations. This systemic blockage hints at an underlying issue in the message queue handling.• Suspected Firebase Cloud Messaging Cause:
Further investigation into the context of the logs has led us to suspect that Firebase Cloud Messaging (FCM) is triggering this ANR. It appears that when FCM processes and delivers messages, it may be causing delays or interfering with the normal operation of the message queue. This interference could be compounding the thread blockage observed across both UI and background processing threads.
Impact:
User Experience: The ANR results in significant UI freezes, negatively affecting overall user engagement.
System Stability: The involvement of multiple threads—including those related to Unity and background services—indicates that FCM-related processing might be creating a broader contention issue within our application's message handling system.
Request for Investigation:
Examine recent changes in our Firebase Cloud Messaging integration to determine if they might be affecting message queue processing.
Investigate potential thread contention or synchronization issues triggered by FCM callbacks that lead to prolonged blocking in nativePollOnce.
Explore possible mitigations or workarounds to prevent FCM from causing message queue congestion, particularly in environments that combine Unity and native Android components.
ANR Log.txt
Reproducing the issue
initialize firebase and Messaging at Init ANR happens
here is code snippet of initialization
`
private Firebase.FirebaseApp appFirebase = null;
`
Firebase Unity SDK Version
12.6.0
Unity editor version
2022.3.55f1
Installation Method
Unity Package Manager
Problematic Firebase Component(s)
Messaging, In-App Messaging
Other Firebase Component(s) in use
Analytics, Crashlytics, Messaging, In-App Messaging
Additional SDKs you are using
ByteBrew SDK = 0.1.9,
Google AdMob = 9.2.0,
Playfab = 2.209.250228
Playmaker = 1.9.4.f
Targeted Platform(s)
Android
Unity editor platform
Windows, Mac
Scripting Runtime
IL2CPP
Release Distribution Type
Pre-built SDK from https://firebase.google.com/download/unity
Relevant Log Output
If using CocoaPods for Apple platforms, the project's Podfile.lock
Expand
Podfile.lock
snippet👀 Replace this line with the contents of your Podfile.lock!
The text was updated successfully, but these errors were encountered: