firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.27k stars 574 forks source link

Firebase RealtimeDatabase not working on Android P with mobile data #439

Closed tomriddle25 closed 4 years ago

tomriddle25 commented 5 years ago

RealtimeDatabase fails to connect when using Mobile Data on Android P.

It fails with the following log

D/PersistentConnection: pc_0 - Got on disconnect due to OTHER

This issue looks a lot similar to #124

samtstern commented 5 years ago

@tomriddle25 what sort of device are you using and does this happen every time?

google-oss-bot commented 5 years ago

Hey @tomriddle25. We need more information to resolve this issue but there hasn't been an update in 7 days. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

tomriddle25 commented 5 years ago

@samtstern I had been getting this issue across a varied range of devices(most prominently a OnePlus 6 and 6T) but the most peculiar has been the network. There are some network carriers , for instance Vodafone IN, over which I seem to face this issue.

samtstern commented 5 years ago

@tomriddle25 thanks for the information. So do you still see this issue or it went away?

tomriddle25 commented 5 years ago

@samtstern Yes I am still facing this issue, as mentioned, across a lieu of devices.

r0b0t3d commented 5 years ago

I got this issue as well. But in my case, wifi is causing the problem. 3G network is fine. What I observed.

  1. Using wifi => Could not read data from database. Logs below (I copied from #124 because they are the same).

2019-03-18 16:21:12.138 D/WebSocket: ws_1 - timed out on connect 2019-03-18 16:21:12.139 D/WebSocket: ws_1 - closed 2019-03-18 16:21:12.139 D/WebSocket: ws_1 - closing itself 2019-03-18 16:21:12.139 D/Connection: conn_1 - Realtime connection failed 2019-03-18 16:21:12.139 D/Connection: conn_1 - closing realtime connection 2019-03-18 16:21:12.139 D/PersistentConnection: pc_0 - Got on disconnect due to OTHER 2019-03-18 16:21:12.139 D/PersistentConnection: pc_0 - Scheduling connection attempt 2019-03-18 16:21:12.140 D/ConnectionRetryHelper: Scheduling retry in 539ms 2019-03-18 16:21:12.682 D/PersistentConnection: pc_0 - Trying to fetch auth token 2019-03-18 16:21:12.689 D/PersistentConnection: pc_0 - Successfully fetched token, opening connection 2019-03-18 16:21:12.692 D/Connection: conn_2 - Opening a connection 2019-03-18 16:21:42.697 D/WebSocket: ws_2 - timed out on connect 2019-03-18 16:21:42.699 D/WebSocket: ws_2 - closed 2019-03-18 16:21:42.699 D/WebSocket: ws_2 - closing itself 2019-03-18 16:21:42.699 D/Connection: conn_2 - Realtime connection failed 2019-03-18 16:21:42.699 D/Connection: conn_2 - closing realtime connection 2019-03-18 16:21:42.700 D/PersistentConnection: pc_0 - Got on disconnect due to OTHER 2019-03-18 16:21:42.700 D/PersistentConnection: pc_0 - Scheduling connection attempt 2019-03-18 16:21:42.702 D/ConnectionRetryHelper: Scheduling retry in 580ms 2019-03-18 16:21:43.284 D/PersistentConnection: pc_0 - Trying to fetch auth token 2019-03-18 16:21:43.287 D/PersistentConnection: pc_0 - Successfully fetched token, opening connection

  1. Try to relaunch app many times. But still got logs above
  2. Kill app. Switch to 3G network => App get data successfully
  3. Kill app. Switch back to wifi => App get data successfully

My device: Samsung 6 Edge (6.0.1) Using latest version com.google.firebase:firebase-database:19.0.0.

UPDATED: I tried to restart wifi router, It's working well now.

achuinard commented 5 years ago

I too had this issue on my Comcast router at home, and hard resetting the router fixed it. Can't believe it. My app uses Firestore and Realtime Database, and only Realtime Database wouldn't connect.

Crazy.

robillo commented 5 years ago

Was facing the same issue on my Nokia 7 Plus - socket connection fails in case of mobile data, but succeeds in case of wifi. Force stopped the app and reopened - now it is working in both cases. I tried the code on other devices - works in both cases on One Plus 6T.

Temporary solution:

SharathBoggaram commented 5 years ago

Even I saw this Problem in my device - Moto G4 - 6.0.1 For long time things was working good. Some reason I did below steps - Phone is connected to WIFI & Mobile data

  1. Turn ON/OFF - Airplane mode
  2. Turn OFF - WIFI
  3. Now the app should suppose to work in only in Mobile data but any changes in Online Realtime DB data is not not updated to local device vise versa. But when I turn ON WIFI all the data is update smoothly in device.
aguatno commented 4 years ago

Hi @tomriddle25 Sorry for the delay here. We usually mention to developers that the issue may be isolated to certain network providers that possibly blocks access to certain services. However, if this isn't the case, then there may be something else that is causing it. With that, I would like to ask for the following details in order for me to understand the issue further:

google-oss-bot commented 4 years ago

Hey @tomriddle25. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 4 years ago

Since there haven't been any recent updates here, I am going to close this issue.

@tomriddle25 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

mparpaillon commented 4 years ago

@aguatno I think I have the same issue on the web SDK here https://github.com/firebase/firebase-js-sdk/issues/2802 Hopefully the logs will help you resolve this issue.