I have been getting this issue.. followed the upgrade guide for new firebase sdk...saved the google services json file in app directory.. still the same error as you but for
Extending @Ian Barber's solution, you can try this generic check to skip processing your custom Application.onCreate for all non-main processes. If the additional processes don't belong to you, then you don't want any of your custom to run.
@Override
public void onCreate() {
super.onCreate();
if (FirebaseApp.getApps(this).isEmpty()) {
// No firebase apps; we are in a non-main process
// skip custom Application.onCreate
return;
}
// Firebase init only in the main process
FirebaseDatabase.getInstance().setPersistenceEnabled(true);
// other code
}