Skip to content

Instantly share code, notes, and snippets.

@vellrya
vellrya / App.kt
Last active March 4, 2024 13:35
Fix "FirebaseApp is not initialized in this process"
class App : Application() {
var mainProcess = false
var metricaProcess = false
override fun onCreate() {
val processName = ProcessUtil.getProcessName(this)
mainProcess = processName==packageName
metricaProcess = processName.contains(":AppMetrica") || processName.contains(":Metrica")
if (!metricaProcess) { // you do not need to initialise anything manually inside the Metrica process