firebase / firebase/firebase-android-sdk

Flutter Android ANR reported in Google Play Console – main thread shows android.os.MessageQueue.nativePollOnce

Open
#7,930 5 comments 0 reactions 0 assignees View on GitHub
api: core
Dominant language
Java
Stars
2.6k
Forks
710
Avg merge
2d 9h
Merged PRs (30d)
31

Description

We are observing ANR reports in production for our Flutter Android application distributed via the Google Play Store.

The ANR stacktrace captured in Play Console shows the main thread waiting in:

at android.os.MessageQueue.nativePollOnce(Native method)
at android.os.MessageQueue.next(MessageQueue.java:339)
at android.os.Looper.loopOnce(Looper.java:176)
at android.os.Looper.loop(Looper.java:324)
at android.app.ActivityThread.main(ActivityThread.java:8547)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1061)

The native portion includes:

Thread-3 (native):tid=12 systid=24801
#00 pc 0x4f85c libc.so (syscall + 28) (BuildId: 6df9129278d4aa93fd96a5fdd121f30b)
#01 pc 0x54430 libc.so (__futex_wait_ex + 144) (BuildId: 6df9129278d4aa93fd96a5fdd121f30b)
#02 pc 0xc0e08 libc.so (pthread_cond_wait + 72) (BuildId: 6df9129278d4aa93fd96a5fdd121f30b)
#03 pc 0x1bd28 split_config.arm64_v8a.apk + 80625664
#04 pc 0x52fcc split_config.arm64_v8a.apk + 80625664

This indicates that the main thread appears to be idle and waiting for messages.

However, the ANR is categorized as User-perceived ANR in Google Play Console.

Production Impact
From Play Console (last 7 days):
24,091 ANR events
12,816 affected users

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.