3

I would like to use Jetpack Compose's 'Deploy Preview' functionality. After I tried to deploy, my app crashed due to Firebase Performance. I tried a several unsuccessful solutions, so I'm looking for additional advice.

Stacktrace

Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.myapp.android.legacy.test. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(FirebaseApp.java:186)
at com.google.firebase.perf.FirebasePerformance.getInstance(FirebasePerformance.java:132)
at com.google.firebase.perf.FirebasePerformanceInitializer.onAppColdStart(FirebasePerformanceInitializer.java:29)
at com.google.firebase.perf.application.AppStateMonitor.sendAppColdStartUpdate(AppStateMonitor.java:322)
at com.google.firebase.perf.application.AppStateMonitor.onActivityResumed(AppStateMonitor.java:240)
at android.app.Application.dispatchActivityResumed(Application.java:455)
at android.app.Activity.dispatchActivityResumed(Activity.java:1291)
at android.app.Activity.onResume(Activity.java:1819)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1454)
at android.app.Activity.performResume(Activity.java:8111)
...

Solution 1

I removed FirebasePerformance from Kotlin and Java files. Same error.

Solution 2

In addition to solution 1, I deleted FirebasePerformance from gradle files. Deploying worked! But I still need Firebase Performance.

Solution 3

The Firebase Performance Monitoring Plugin and Library were disabled via Disable the library at compile time, but do not allow your app to enable it at runtime and Disable the plugin via a Project Property flag. No effect on the crash.

Solution 4

Downgraded com.google.gms:google-services from 4.3.14 to 4.0.0 - compile error: Cannot invoke method get() on null object. Downgraded to 4.2.0 - original issue

Solution 5

Manually called FirebaseApp.initializeApp(this); in MyApplication.onCreate(). The issue remained the same.

Specs

Android Studio Dolphin 2021.3.1 Patch 1; Kotlin version 1.6.10; Android Tools version 7.0.4; Samsung Galaxy S8 running Android 10

clever_trevor
  • 1,530
  • 2
  • 22
  • 42

0 Answers0