In my code user signs in to Firebase with Google like explained in:
https://firebase.google.com/docs/auth/android/google-signin
This works fine.
When
I was struggling with this issue for two days and found the real-time database just cannot work on the specified WIFI, that was my office's WIFI. It can work on the mobile data and even the hotspot signal from other mobile phones. I finally resolved it by restarting the WIFI router in our office, but cannot figure out the behind reason.