Skip to content

FirebaseApp is not initialized in this process #4693

Closed
@hram

Description

@hram

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • 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:
  • Firebase Component: com.google.firebase:firebase-bom:31.2.2
  • Component version:

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  1. Add annotation @AddTrace to function onCreate() in the Application class
  2. Init firebase FirebaseApp.initializeApp(this) inside function onCreate()
  3. Start app
  4. Application crashes on startup

Relevant Code:

Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process <my app id>:Metrica. Make sure to call FirebaseApp.initializeApp(Context) first.
        at com.google.firebase.FirebaseApp.getInstance(FirebaseApp.java:179)
        at com.google.firebase.perf.config.RemoteConfigManager.getInitialStartupMillis(RemoteConfigManager.java:91)
        at com.google.firebase.perf.config.RemoteConfigManager.<init>(RemoteConfigManager.java:85)
        at com.google.firebase.perf.config.RemoteConfigManager.<clinit>(RemoteConfigManager.java:52)
        at com.google.firebase.perf.config.RemoteConfigManager.getInstance(RemoteConfigManager.java:119) 
        at com.google.firebase.perf.config.ConfigResolver.<init>(ConfigResolver.java:78) 
        at com.google.firebase.perf.config.ConfigResolver.getInstance(ConfigResolver.java:86) 
        at com.google.firebase.perf.application.AppStateMonitor.<init>(AppStateMonitor.java:98) 
        at com.google.firebase.perf.application.AppStateMonitor.getInstance(AppStateMonitor.java:87) 
        at com.google.firebase.perf.metrics.Trace.<init>(Trace.java:106) 
        at com.google.firebase.perf.metrics.Trace.create(Trace.java:98) 
        at com.google.firebase.perf.FirebasePerformance.startTrace(FirebasePerformance.java:213) 
        at <my app id>.App.onCreate(Unknown Source:6) 
        at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1118) 
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5791) 
        at android.app.ActivityThread.-wrap1(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6541) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions