Repository navigation
Critical Startup ANRs during FirebaseApp.initializeApp on Android #2754
Description
Activity
The ANR stack always points to FirebaseApp.initializeApp.
main (runnable):tid=1 systid=21569
at com.google.firebase.messaging.FirebaseMessaging.(FirebaseMessaging.java:153)
at com.google.firebase.messaging.FirebaseMessagingRegistrar.lambda$getComponents$0(FirebaseMessagingRegistrar.java:69)
at com.google.firebase.heartbeatinfo.DefaultHeartBeatController$$ExternalSyntheticLambda0.e(R8$$SyntheticClass:8)
at com.google.firebase.tracing.ComponentMonitor.lambda$processRegistrar$0(ComponentMonitor.java:38)
at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:160)
at com.google.firebase.components.Lazy.get(Lazy.java:53)
at com.google.firebase.components.ComponentRuntime.doInitializeEagerComponents(ComponentRuntime.java:322)
at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(ComponentRuntime.java:312)
at com.google.firebase.FirebaseApp.initializeAllApis(FirebaseApp.java:607)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:300)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:264)
at com.xxx.xxx.FirebaseUtil.initFirebase(FirebaseUtil.java:63)
at com.xxx.xxx.Application.onCreate(Application.kt:138)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1386)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7685)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(unavailable)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2505)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8927)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:681)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:915)// This call is identified as the main thread blocker in ANR traces firebaseApp = FirebaseApp.initializeApp(context, option)?.apply { setAutomaticResourceManagementEnabled(true) }}
// This call is identified as the main thread blocker in ANR traces firebaseApp = FirebaseApp.initializeApp(context, option)?.apply { setAutomaticResourceManagementEnabled(true)}
Have you get any solution for this ANR
I am facing the same exact ANRs. in my appWe are also facing same issue, is there any workaround or planned fix?
- marked Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Touch and hold a clip to pin it. Unpinned quickstart-testing#456 as a duplicate of this issue
on Jun 11, 2026 - unmarked Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Use the edit icon to pin, add or delete clips.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Touch and hold a clip to pin it. Unpinned clips will be deleted after 1 hour.Touch and hold a clip to pin it. Unpinned quickstart-testing#456 as a duplicate of this issue
on Jun 11, 2026
Step 2: Describe the problem:
We are experiencing a high volume of startup ANRs (Application Not Responding) on our production Android app, specifically during the Firebase initialization process.
History of Attempts to Fix:
Steps to reproduce:
Clicking the icon to launch the application may reproduce this issue on low- to mid-range devices. The screen remains black and unresponsive upon launch.The ANR tracker consistently shows that the main thread is stuck at
FirebaseApp.initializeApp. It appears that internal components (such as Analytics or Crashlytics) are performing time-consuming synchronous I/O or lock contention during initialization.Relevant Code:
// In Application.kt
override fun onCreate() {
super.onCreate()
// Manual initialization to avoid ContentProvider blocking
FirebaseUtil.initFirebase(this)
}
fun initFirebase(context: Application) {
runCatching {
val option = FirebaseOptions.Builder().apply {
setApplicationId(AppConstants.APP_ID_RESOURCE_NAME)
setApiKey(AppConstants.API_KEY_RESOURCE_NAME)
setProjectId(AppConstants.PROJECT_ID_RESOURCE_NAME)
setGcmSenderId(AppConstants.GCM_SENDER_ID_RESOURCE_NAME)
setStorageBucket(AppConstants.STORAGE_BUCKET_RESOURCE_NAME)
}.build()
}
In AndroidManfiest.xml
ANR traces::
main (runnable):tid=1 systid=5624
at com.google.firebase.crashlytics.internal.common.CrashlyticsReportDataCapture.(CrashlyticsReportDataCapture.java:14)
at com.google.firebase.crashlytics.internal.common.SessionReportingCoordinator.create(SessionReportingCoordinator.java:75)
at com.google.firebase.crashlytics.internal.common.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:163)
at com.google.firebase.crashlytics.FirebaseCrashlytics.init(FirebaseCrashlytics.java:168)
at com.google.firebase.crashlytics.CrashlyticsRegistrar.buildCrashlytics(CrashlyticsRegistrar.java:79)
at com.google.firebase.tracing.ComponentMonitor.lambda$processRegistrar$0(ComponentMonitor.java:38)
at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:160)
at com.google.firebase.components.Lazy.get(Lazy.java:53)
at com.google.firebase.components.ComponentRuntime.doInitializeEagerComponents(ComponentRuntime.java:322)
at com.google.firebase.components.ComponentRuntime.initializeEagerComponents(ComponentRuntime.java:312)
at com.google.firebase.FirebaseApp.initializeAllApis(FirebaseApp.java:607)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:300)
at com.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:264)
at com.xxx.xxx.FirebaseUtil.initFirebase(FirebaseUtil.java:63)
at com.xxx.xxx.Application.onCreate(Application.kt:138)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1386)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7648)
at android.app.ActivityThread.-$$Nest$mhandleBindApplication(unavailable)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2477)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8886)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:681)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:915)