Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 373
andrewedgar Avatar asked Nov 15 '18 23:11

andrewedgar


1 Answers

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

like image 134
andrewedgar Avatar answered Oct 05 '22 12:10

andrewedgar