firebase-android-sdk: IllegalStateException FirebaseCrashlytics.getInstance

We recently migrated from Fabric to FirebaseCrashlytics and started seeing IllegalStateExceptions.

Copying over the stacktrace from play console.

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5929)
  at android.app.ActivityThread.access$1200 (ActivityThread.java:209)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1681)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:193)
  at android.app.ActivityThread.main (ActivityThread.java:6724)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:911)
Caused by: java.lang.IllegalStateException: 
  at com.google.firebase.FirebaseApp.getInstance (FirebaseApp.java:184)
  at com.google.firebase.crashlytics.FirebaseCrashlytics.getInstance (FirebaseCrashlytics.java:112)
  at <package_name>.CustomApplication.onCreate (CommCareApplication.java:195)
  at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1154)
  at android.app.ActivityThread.handleBindApplication (ActivityThread.java:5924)
  at android.app.ActivityThread.access$1200 (ActivityThread.java:209)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1681)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:193)
  at android.app.ActivityThread.main (ActivityThread.java:6724)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:911)

This crash appears to be only happening for a particular device.

Blackview BV5500Pro (Android 9)

I don’t have any more details, neither do I have that device to test it out. So posting it here, if someone else also notices the issue on the same device or some other devices as well.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 26 (13 by maintainers)

Most upvoted comments

@kangaman2205 if your app is not direct boot aware then it’s unlikely the issue you’re facing, although without any more data on the crash I am unable to either reproduce or even think of how it could even happen, as direct boot is the only time firebase does not initialize automatically and instead only initializes upon device unlock.

@doubleo2 thanks for the details, we will release firebase-common in an upcoming release within a few weeks. One word of caution though: most firebase SDKs don’t have official direct boot support, so they may or may not work, the only SDKs that support directboot explicitly are firebase-common and firebase-messaging-directboot.

@rosariopfernandes a release is required as each sdk depends on a specific version of firebase-common.