ANR during FirebaseInitProvider.onCreate - SimpleArrayMap/ContainerHelpersKt class initialization
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Ít trao đổi
- Lĩnh vực
- mobile, performance
Hướng nghiên cứu
Bắt đầu bằng cách truy vết FirebaseInitProvider.onCreate qua quá trình khởi tạo lớp FirebaseApp, tập trung vào việc tải SimpleArrayMap và ContainerHelpersKt trên main thread như đã được báo cáo. So sánh các startup trace từ những thiết bị cấp thấp bị ảnh hưởng và kiểm tra đường dẫn khởi tạo của firebase-common; công việc được xem là hoàn tất khi xác lập được nguyên nhân có thể tái hiện hoặc một biện pháp giảm thiểu được hỗ trợ rõ ràng, với độ bao phủ cho hành vi startup liên quan.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[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.
- Ngôn ngữ chính
- Java
- Star
- 2.6k
- Fork
- 733
- Merge trung bình
- 2 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 72
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firebase/firebase-android-sdk
-
api: remoteconfig
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
firebase/firebase-android-sdk#8827 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Crashlytics plugin writes build ID lists in directory listing order, so APKs can differ between machinesCó thể đã có người làm @mrober đã nhận 8 ngày trước. Đang mởapi: crashlytics
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
firebase/firebase-android-sdk#8789 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
api: auth
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
firebase/firebase-android-sdk#8505 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
firebase/firebase-android-sdk#8835 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
firebase/firebase-android-sdk#8832 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của firebase/firebase-android-sdk
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
RIS export splits an organization name containing “and” into multiple authorsCó thể đã có người làm @Gautam-aman đã nhận hôm nay. Đang mởstatus: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
JabRef/jabref#17821 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
FailureContext.java rounds down thresholds in lastedAtLeast()Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày