question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IllegalStateException FirebaseCrashlytics.getInstance

See original GitHub issue

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.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
vkryachkocommented, Jul 31, 2020

@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.

0reactions
DJHoltkampcommented, Sep 11, 2020

I am still getting a crash occasionally on my logs from Firebase. This particular log is coming from Android 7

java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2927) at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2988) at android.app.ActivityThread.-wrap14 (ActivityThread.java) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1631) at android.os.Handler.dispatchMessage (Handler.java:102) at android.os.Looper.loop (Looper.java:154) at android.app.ActivityThread.main (ActivityThread.java:6682) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1410) Caused by: java.lang.IllegalStateException: at com.google.firebase.FirebaseApp.getInstance at com.google.firebase.iid.FirebaseInstanceId.getInstance at org.cocos2dx.cpp.AppActivity.onCreate (AppActivity.java:135) at android.app.Activity.performCreate (Activity.java:6942) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2880)

What is the recommended fix for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

FirebaseCrashlytics.getInstance() is Crashing App In Multi ...
When calling FirebaseCrashlytics.getInstance() in Activity with another Process the App just crashes without generating any single Stack ...
Read more >
com.google.firebase.crashlytics.FirebaseCrashlytics
This page shows Java code examples of com.google.firebase.crashlytics. ... getInstance(); crashlytics.log(message); if (throwable != null && priority == Log ...
Read more >
FirebaseCrashlytics - Google
By default, Firebase Crashlytics is automatically initialized. Call FirebaseCrashlytics#getInstance() to get the singleton instance of FirebaseCrashlytics.
Read more >
FirebaseCrashlytics.getInstance() is Crashing App In Multi ...
Coding example for the question FirebaseCrashlytics.getInstance() is Crashing App In Multi-Process App-kotlin.
Read more >
用户对问题“如何检查Firebase Crashlytics是否已初始化?”的回答
在没有检查的情况下,我们在运行单元测试时会得到类似这样的结果:. java.lang.IllegalStateException: Default FirebaseApp is not initialized ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found