Luke Luke - 6 months ago 269
Android Question

Enabling offline capabilities throws "java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist."

I'm attempting to migrate my app to Firebase 3. I'm attemping to enable data persistence in my Application class using the following line of code:

FirebaseDatabase.getInstance().setPersistenceEnabled(true);


However, the following exception is thrown and the app crashes:

java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.


All other features are working as expected, has anyone else got this working?

Answer

Remove or comment this line in your build.gradle:

compile 'com.google.firebase:firebase-crash:9.0.0'