When processing a leak, I get a java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.
inside my Application.onCreate
. From what I understand, this happens because LeakCanary creates my application class without all the Google Play Services stuff and Firebase cannot initialize successfully. Any ideas how to fix this?
Edit:
I'm using leakcanary-android:1.4-beta2
and this happens after dumping the heap.
Alternatively you could leave the google play services plugin configuration as suggested by the documentation.
Disable FirebaseInitProvider by adding this to AndroidManifest.xml
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:enabled="false" />
And add this to your Application class
FirebaseOptions options = FirebaseOptions.fromResource(this);
FirebaseApp.initializeApp(this, options);
This way you don't have to configure FirebaseOptions by hand.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With