nishant pathak nishant pathak - 6 months ago 141
Android Question

Firebase realtime database crash when android application used offline

I am using firebase offline database for my android app, in PreferenceScreen and load dynamic config data.

compile ''

Using it as:


I am using it as per tutorial:

App works fine when it is connected, on offline it is crashing with below stack trace

Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.nishant.starterkit.mock.
Make sure to call FirebaseApp.initializeApp(Context) first.
at Source)
at Source)


Seems like your app has multiple process. Make sure you initialize firebase database only through Context of your application.

    if (!FirebaseApp.getApps(this).isEmpty()) {

You should initialize firebase DB as mentioned above.