ANR during FirebaseInitProvider.onCreate - SimpleArrayMap/ContainerHelpersKt class initialization
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 静か
- 領域
- mobile, performance
調査の方向性
まず、FirebaseApp クラスの初期化まで FirebaseInitProvider.onCreate を追跡し、メインスレッドで報告されている SimpleArrayMap と ContainerHelpersKt のロードに注目します。影響を受けている低性能デバイスの startup trace を比較し、firebase-common の初期化パスを調査します。再現可能な原因、または明確に裏付けられた緩和策を確立し、関連する startup 挙動をカバーできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
[READ] Step 1: Are you in the right place?
- For general technical questions, post a question on StackOverflow
with the firebase tag. - For general Firebase discussion, use the
firebase-talk google group. - For help troubleshooting your application that does not fall under one of the above categories,
reach out to the personalized Firebase support channel.
[REQUIRED] Step 2: Describe your environment
- Android Studio version: Android Studio Otter | 2025.2.1 Patch 1
- Firebase Component: Firebase Core (firebase-common)
- Component version: BOM 34.3.0
[REQUIRED] Step 3: Describe the problem
We are seeing ANRs during app cold start caused by slow class static initialization (<clinit>) in FirebaseApp triggered by FirebaseInitProvider.onCreate() on the main thread. The main thread is blocked performing class loading/verification of androidx.collection.SimpleArrayMap and ContainerHelpersKt with no lock contention and all other threads are idle.
This impacts lower-end devices during cold start. Since FirebaseInitProvider runs as a ContentProvider it blocks the entire app startup path before Application.onCreate() is even called.
We are already on the latest androidx.collection (1.5.0 resolved).
Steps to reproduce:
Cannot reproduce locally. Observed in production via Crashlytics on lower-end devices during cold start.
"main" tid=1 Runnable
at androidx.collection.SimpleArrayMap.<init> (SourceFile:65354)
at com.google.firebase.FirebaseApp.<clinit> (SourceFile:65354)
at com.google.firebase.provider.FirebaseInitProvider.onCreate (SourceFile:65348)
at android.content.ContentProvider.attachInfo (ContentProvider.java:2648)
at android.content.ContentProvider.attachInfo (ContentProvider.java:2616)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo (SourceFile:65352)
at android.app.ActivityThread.installProvider (ActivityThread.java:8490)
at android.app.ActivityThread.installContentProviders (ActivityThread.java:8003)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:7667)
Stack trace 2:
at androidx.collection.internal.ContainerHelpersKt.<clinit> (SourceFile:65354)
at androidx.collection.SimpleArrayMap.<init> (SourceFile:65354)
at com.google.firebase.FirebaseApp.<clinit> (SourceFile:65354)
at com.google.firebase.provider.FirebaseInitProvider.onCreate (SourceFile:65348)
at android.content.ContentProvider.attachInfo (ContentProvider.java:2648)
at android.content.ContentProvider.attachInfo (ContentProvider.java:2616)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo (SourceFile:65352)
at android.app.ActivityThread.installProvider (ActivityThread.java:8490)
at android.app.ActivityThread.installContentProviders (ActivityThread.java:8003)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:7667)
In both cases, all other threads (binder, daemon, SharedPreferences, etc.) are idle or in waiting state — no lock contention is involved.
What happened? How can we make the problem occur? This could be a description, log/console output,
etc.
Device & OS breakdown
Android versions: Android 15 (SDK 35), Android 16 Beta (SDK 36)
Visibility: Foreground
Top affected devices:
- realme RE6095
- realme RE6054
- realme RE58BC
- realme RE5C9F
Relevant Code:
// No app code involved. ANR occurs before Application.onCreate()
// during ContentProvider initialization triggered by the system.
// FirebaseInitProvider is auto-merged into the manifest by the Firebase SDK.
- 主要言語
- Java
- スター
- 2.6k
- フォーク
- 733
- 平均マージ
- 2日 15時間
- マージ済み PR(30日)
- 72
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
firebase/firebase-android-sdk のほかの issue
-
api: remoteconfig
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
firebase/firebase-android-sdk#8827 ·
メンテナーはふだん 1 日以内に返信
-
Crashlytics plugin writes build ID lists in directory listing order, so APKs can differ between machines対応中かも @mrober が 8 日前に担当しました。 オープンapi: crashlytics
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
firebase/firebase-android-sdk#8789 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
api: auth
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
firebase/firebase-android-sdk#8505 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 15/100
firebase/firebase-android-sdk#8835 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
firebase/firebase-android-sdk#8832 ·
メンテナーはふだん 1 日以内に返信
firebase/firebase-android-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
RIS export splits an organization name containing “and” into multiple authors対応中かも @Gautam-aman が今日担当しました。 オープンstatus: needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
JabRef/jabref#17821 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
FailureContext.java rounds down thresholds in lastedAtLeast()対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
メンテナーはふだん 1 日以内に返信