Skip to content Skip to sidebar Skip to footer

Is There A Way To Fix The Error "will Not Attempt Reconnect. Reason: Database Lives In A Different Region." In Android Studio With Firebase

When I try and sign-up in my app, the progress bar just runs endlessly because my app isn't able access the database. I've tried a few solutions on getting an updated googles-servi

Solution 1:

Want to add to @Frank's answer.


Even after downloading an updated google-services.json file, or changing the url manually, it might not work.

In that case, we'll have to delete the build and .dart_tool folders in our project folder, and recompile the app again after stopping.

Because even after changing the google-services.json file, the changes don't take place (like it happened in my case.).

Solution 2:

You need to pass the URL every time you call FirebaseDatabase.getInstance(), not just the first one.

So:

FirebaseDatabasedb= FirebaseDatabase.getInstance("https://bioapps-customer-services-default-rtdb.asia-southeast1.firebasedatabase.app/");
db.getReference().child("RegData")

Alternatively, you can also download an up to date google-services.json and drop that into your app. If the correct URL is in there, the SDK will read it from there when you call FirebaseDatabase.getInstance() without arguments.

Solution 3:

After downloading the new google-services.json you need to run flutter clean hopefully it might works

Post a Comment for "Is There A Way To Fix The Error "will Not Attempt Reconnect. Reason: Database Lives In A Different Region." In Android Studio With Firebase"