-
Notifications
You must be signed in to change notification settings - Fork 606
FirebasePerformance crash for separate process java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process #6039
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
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Hi @alexklints, thank you for for reaching out and raising the issue. Thank you for sharing an MCVE. I was able to reproduce the issue from version 31.2.0 up to the latest version. I'll notify our engineers about and see what we can do here. Thanks! |
Firebase only initializes automatically on the default process of an app. If you have a multi-process app, you need to initialize manually in each process or not use Firebase in the other processes. To initialize manually, you could do something like this: class MyApp : Application() {
override fun onCreate() {
super.onCreate()
// Initialize Firebase in other processes.
if (getProcessName() != applicationInfo.processName) {
FirebaseApp.initializeApp(applicationContext)
}
}
} |
Hi. I understand, but the thing is, the behavior used to be different. Firebase Performance did not attempt to intercept the network if there was no initialization in the process. There are such examples of an issue where developers tried to implement this behavior:
|
I took a look, and this was fixed in Firebase Perf 21.0.1, can you try the latest version @alexklints? |
Please open a new issue if this was not resolved in the latest version for you. |
[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:
with the firebase tag.
google group.
of the above categories, reach out to the personalized
Firebase support channel.
[REQUIRED] Step 2: Describe your environment
com.google.firebase:firebase-perf
com.google.firebase:firebase-bom:33.1.0
(Reproduced sincecom.google.firebase:firebase-bom:31.5.0
)[REQUIRED] Step 3: Describe the problem
Calling
URL.openConnection()
from separate process will lead crash with Firebase Performance.Stacktrace
Steps to reproduce:
It works correct up to
com.google.firebase:firebase-bom:31.0.0
.Relevant Code:
Example with network request from separate process
The text was updated successfully, but these errors were encountered: