FirebaseFirestore has already been started and its settings can no longer be changed

Viewed 6046

I am trying to turn off persistence for an activity but I am getting the message above. Here is how I am configuring the settings in onCreate():

        mFirestore = FirebaseFirestore.getInstance();
        FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder().setPersistenceEnabled(false).build();
        mFirestore.setFirestoreSettings(settings);

Where do I call this if not right after?

1 Answers

Looks like you have to set the settings in your very first activity when your app opens and have them persist throughout.

Related