Open alexklints opened 1 week ago
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?
[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:
[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. StacktraceSteps to reproduce:
It works correct up to
com.google.firebase:firebase-bom:31.0.0
.Relevant Code:
Example with network request from separate process