Issue
W/PersistentConnection( 4812): pc_0 - Firebase Database connection was forcefully killed by the server. Will not attempt reconnect. Reason: Database lives in a different region. Please change your database URL to https://multiapp-f0e1e-default-rtdb.europe-west1.firebasedatabase.app
Solution
This happens because, when you created your project at that time the Realtime Database was not enabled, that's why the google-services.json
file don't contain the url
to our Realtime Database.
I was also faced with a same problem, here's what I did.
We can also download an updated google-services.json
file. But I manually added the url.
from this:
{
"project_info": {
"project_number": "xxx4071207xxx",
"project_id": "xxxantonixxx",
"storage_bucket": "xxxantonixxx.appspot.com"
},
to this:
{
"project_info": {
"project_number": "xxx4071207xxx",
"firebase_url": " https://multiapp-f0e1e-default-rtdb.europe-west1.firebasedatabase.app",
"project_id": "xxxantonixxx",
"storage_bucket": "xxxantonixxx.appspot.com"
},
You'll get your database Url from here:
But wait... it still might not work.
If you make changes to the google-services.json
file. And recompile the app from start, still the changes DONOT take place immediately.
In my case, even if I deleted the google-services.json
file and recompile the app again, it was working similar to before deleting.
Solution:##
So, in that case, we'll have to delete the build
and .dart_tool
folder in our project folder, and then recompile the app again from start.
I came to know about this after I wasted my 2 whole days, working in some other direction. That's why I had to share it, so that it doesn't happen to anybody else.
Answered By - Madhav
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.