Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANRs at com.google.firebase.perf.metrics.AppStartTrace.registerActivityLifecycleCallbacks #6609

Open
Hitarth27 opened this issue Dec 30, 2024 · 3 comments

Comments

@Hitarth27
Copy link

[REQUIRED] Step 2: Describe your environment

  • Firebase Component: Firebase Performance (Database, Firestore, Storage, Functions, etc)
  • Dependencies -

In module build.gradle
"com.google.firebase:perf-plugin:1.4.2"
"com.google.firebase:firebase-crashlytics-gradle:3.0.2"

In app build.gradle
implementation platform("com.google.firebase:firebase-bom:33.3.0")

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Receiving a high number of ANR's (> 4K in 1 month) in firebase performance class with following stack trace. The ANR's are 100% Android 14, 100% background.

      main (runnable):tid=1 systid=32687 
   at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:174)
   at com.google.firebase.perf.metrics.AppStartTrace.registerActivityLifecycleCallbacks(AppStartTrace.java:212)
   at com.google.firebase.perf.FirebasePerfEarly.<init>(FirebasePerfEarly.java:50)
   at com.google.firebase.perf.FirebasePerfRegistrar.lambda$getComponents$0(FirebasePerfRegistrar.java:75)
   at com.google.firebase.heartbeatinfo.DefaultHeartBeatController$$ExternalSyntheticLambda0.d(R8$$SyntheticClass:14)
   at com.google.firebase.components.Component.getFactory(Component.java:133)
   at com.google.firebase.tracing.ComponentMonitor.lambda$processRegistrar$0(ComponentMonitor.java:38)
   at com.google.firebase.components.ComponentRuntime.lambda$discoverComponents$0(ComponentRuntime.java:159)
   at com.google.firebase.components.Lazy.get(Lazy.java:53)
   at com.google.firebase.components.Component.isAlwaysEager(Component.java:155)
   at com.google.firebase.components.ComponentRuntime.doInitializeEagerComponents(ComponentRuntime.java:321)
   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.google.firebase.FirebaseApp.initializeApp(FirebaseApp.java:249)
   at com.google.firebase.provider.FirebaseInitProvider.onCreate(FirebaseInitProvider.java:69)
   at android.content.ContentProvider.attachInfo(ContentProvider.java:2621)
   at android.content.ContentProvider.attachInfo(ContentProvider.java:2590)
   at com.google.firebase.provider.FirebaseInitProvider.checkContentProviderAuthority(FirebaseInitProvider.java:86)
   at com.google.firebase.provider.FirebaseInitProvider.attachInfo(FirebaseInitProvider.java:60)
   at android.app.ActivityThread.installProvider(ActivityThread.java:7921)
   at android.app.ActivityThread.installContentProviders(ActivityThread.java:7430)
   at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7124)
   at android.app.ActivityThread.-$$Nest$mhandleBindApplication(unavailable)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2328)
   at android.os.Handler.dispatchMessage(Handler.java:106)
   at android.os.Looper.loopOnce(Looper.java:205)
   at android.os.Looper.loop(Looper.java:294)
   at android.app.ActivityThread.main(ActivityThread.java:8394)
   at java.lang.reflect.Method.invoke(Native method)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:640)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)

Relevant Code:

No code as such. Firebase performance plugin is added in build.gradle.
@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@lehcar09
Copy link
Contributor

lehcar09 commented Jan 2, 2025

Hi @Hitarth27, thank you for reaching out. thank you for reaching out. I tried reproducing the issue however I did not encounter the ANR behavior. Usually it is very difficult to look at ANRs in isolation and figure out what's wrong.

By any chance, are you manually initializing Firebase? We have released a version of PerfMon version 21.0.2 that fixes an IllegalStateException when starting a trace before Firebase initializes.

Could you try updating to the latest Firebase SDK version? This is to ensure that you have the latest updates and bug fixes.

@google-oss-bot
Copy link
Contributor

Hey @Hitarth27. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants