firebase-android-sdk: FirebaseApp is not initialized in this process
[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:
- Add annotation @AddTrace to function onCreate() in the Application class
- Init firebase FirebaseApp.initializeApp(this) inside function onCreate()
- Start app
- 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)
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 36
- Comments: 44 (15 by maintainers)
please note that this is occuring too when app has to startup a separate process , related to Firebase initialization on non main processes.
Let me share some new information on this issue:
firebase-bom:31.2.0
and not31.2.2
.firebase-bom:32.1.1
firebase-bom:31.1.1
and below) the issues doesn’t happens! Only on fresh installs that have changes fromfirebase-bom:31.2.0
and above.Thanks @tevjef, I was able to reproduce the same behavior now. I’ll notify our engineers.
classpath ‘com.google.gms:google-services:4.3.8’ is OK but classpath ‘com.google.gms:google-services:4.4.0’ crash
Downgrade to 4.3.15 helps to me
do not close it automatically
was facing issue with ‘com.google.gms:google-services:4.4.0’ but it solved when i changed it to 4.3.0 , Thanks to @engineerStuardo
Thanks a lot for highlighting the issue. Similar to the reference mentioned above, this issue seem to be raising out of Firebase Performance/Remote Config using the Firebase executors instead of its own executors. We are working to reproduce/fix this issue at the earliest. Will keep this issue posted as and when we have updates.
Thanks for your patience as we work through this issue.
We also facing this issue when start a service in new process. The crash still happing in firebase BoM version com.google.firebase:firebase-bom:31.3.0. After investigating, the crash only happened if we used Firebase Perf in our app. We need to upgrade firebase-BoM because of this warning: