Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Couldn't connect to firebase database via WIFI but connects fine with 4G mobile network. Strange issue

Cracked my head for an entire day figuring out what was the issue, tried replacing the firebase .json file and everything but it wouldn't connect to the database via WIFI. Went to shower and thought of ways to solve this, came out of a hot shower with an idea of maybe i should connect via 4G mobile network and it works completely fine!

Did anyone else came across this issue?

(sorry if its kinda vague, would be happy to answer anything related to this problem)

like image 328
Bowie Chang Avatar asked Nov 18 '22 01:11

Bowie Chang


2 Answers

The solution for me was to replace the internet service provider SIM card as I'm using 4G access point in my home.

It seems like the operator is blocking some services. when I switched to another SIM card it worked like charm!

like image 54
Bady Graphics Avatar answered May 31 '23 21:05

Bady Graphics


Please see: https://github.com/firebase/firebase-android-sdk/issues/1258

The short answer is, it's something in the Android networking stack that causes RTDB to not be able to connect to specific WiFi routers (in my case for older Android devices).

If resetting the router doesn't work and cellular is not an option, the only fix I have found is having the user plug a known working router (set to access point mode with DHCP disabled) into a LAN port of their existing router and then connecting the Android device to that access point. In my case I use a TP Link N300 Nano Router and it works well. I imagine replacing the router entirely will also do the trick.

like image 41
policenauts Avatar answered May 31 '23 21:05

policenauts