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

未关闭
#7,930 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
android, flutter

调研方向

从提供的 Google Play Console ANR 报告以及 Android main-thread 和 native 堆栈跟踪开始;其中没有指定 repository 文件、测试或 Firebase 组件。确定该报告是否可以复现或归因于此 SDK,然后记录已确认的原因,以及为解决该问题所需的 repository 更改或说明。

由索引模型根据 Issue 内容生成。

描述

api: core

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

主要语言
Java
星标
2.6k
派生
733
平均合并
2 天 15 小时
30 天内合并 PR
72

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

firebase/firebase-android-sdk 的其他 Issue

查看 firebase/firebase-android-sdk 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。