firebase / quickstart-unity

Firebase Quickstart Samples for Unity
https://firebase.google.com/games
Apache License 2.0
835 stars 431 forks source link

Realtime Database connection is flakey on desktop #106

Closed mirzasohailbaig closed 5 years ago

mirzasohailbaig commented 7 years ago

I'm using unity 5.5.0f3 with Firebase version 4.1.0 and whenever I try to run the Main scene for realtime database using my URL in the app.SetEditorDatabaseUrl("XXX"); it fails I made sure to set these rules { "rules": { ".read": "auth == null", ".write": "auth == null" } }

Another note is this use to work fine before with an older version of the Firebase SDK but now both the new Firebase SDK and the old Firebase SDK version now give me this error when running in editor. I have a feeling there is something blocking it from connecting to my Firebase but i'm not sure what it is.

`8/25/2017 7:31:29 AM [Error] WebSocket: ws_0 - could not connect
System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network.

  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
UnityEngine.Debug:LogError(Object)
Firebase.FirebaseHandler:LogMessage(LogLevel, String)
Firebase.Unity.UnityLoggingService:LogMessage(LogLevel, String)
Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String)
Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level, String, String, Int64)
Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:CreateSocket()
Firebase.Database.Internal.TubeSock.WebSocket:RunReader()
Firebase.Database.Internal.TubeSock.Runnable101:Run()
Google.Sharpen.Thread:InternalRun()
`

`1/2/0001 5:46:04 PM [Error] WebSocket: ws_19 - WebSocketException during handshake
Firebase.Database.Internal.TubeSock.WebSocketException: unknown host: XXX ---> System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network.

  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.RunReader () [0x00000] in <filename unknown>:0 
UnityEngine.Debug:LogError(Object)
Firebase.FirebaseHandler:LogMessage(LogLevel, String)
Firebase.Unity.UnityLoggingService:LogMessage(LogLevel, String)
Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String)
Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level, String, String, Int64)
Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:RunReader()
Firebase.Database.Internal.TubeSock.Runnable101:Run()
Google.Sharpen.Thread:InternalRun()
`
a-maurice commented 7 years ago

Hi,

I can't seem to reproduce the problem you are seeing, but one thing stands out to me in the rules you provided. { "rules": { ".read": "auth == null", ".write": "auth == null" } } means that in order to read and write to the database you need to not be authenticated at all, which seems odd to me. If you want to not require authentication, you can use { ".read": true, ".write": true } If you do want to require authentication, you can use { ".read": "auth != null"... }

If that doesn't help, if I'm reading this correctly the problem is happening in the Firebase editor, and not in a build, correct? And also, what system are you running this on (Windows/Mac/Linux)? That might help us track down what you are seeing.

mirzasohailbaig commented 7 years ago

I tried changing the rules to '{ ".read": true, ".write": true }' which is what i had before but it didn't help. My operating system is Windows and I'm just testing this in the unity editor and looking in the Firebase console to see the new data, and the errors occur in the unity editor console.

a-maurice commented 7 years ago

Hmm, I'll keep looking on my end to see if I can find any problems.

And just to cover all cases, you are running this with an internet connection? Disabling my connection has been the only way I've been able to reproduce it yet, and a socket exception usually indicates a networking problem.

mirzasohailbaig commented 7 years ago

Yes I'm connected to the internet I even tried building to android device to see if it could be a unity editor issue, but that didn't help either.

a-maurice commented 7 years ago

Our best guess is that is has something to do with an internet connection problem, possibly a firewall that is blocking it?

One suggestion is to turn on more log debugging, as we print out through out the connection process. To do so, you can add:

  FirebaseApp.LogLevel = LogLevel.Verbose;
  FirebaseDatabase.DefaultInstance.LogLevel = LogLevel.Verbose;  // Or your database instance, if not using the default.

That should print out what ip address it's trying to use, the socket, etc. which might have some explanation of the problem.

Another thing to try would be connecting directly with the REST api, as that will confirm that you are able to connect to your project at all.

mirzasohailbaig commented 7 years ago

I tried connecting to my phone's hotspot instead and everything works fine on it, so its simply my router that I think someone may have reset and is now blocking connection to Firebase, which explains why it stopped working. However I still can't figure out what settings I can try to get my router to work with Firebase as well, simply turning off firewall did not work. Any advice based on the settings I can mess with be helpful.

options_1 options_2

Editor Console log for details log

Just for details I have Spectrum as my internet provider and I'm using the default router/modem they provided Ubee (model: DDW36C).

mirzasohailbaig commented 7 years ago

Never mind it just took time for my settings to start working on the router and now everything appears to be working fine. Also I believe the three settings I enabled that made Firebase connections possible again were [Multicast Enable, DNS Relay, and UPnP Enable].

Thanks a-maurice your help was much appreciated.

PathToLife commented 6 years ago

I can confirm that this issue is tied into network problems related with routers..

But this is happening way too much to be ignored. Of a team of 10 devs, 5 of them have experienced this problem on public and private networks that otherwise work fine for everything else!

Can we please repoen and try diagnose if there is a way to workaround this? I feel a roll back to a previous version of firebase and installing .net 3.5 in unity will help mitigate these issues.

11/24/2017 5:05:19 AM [Error] WebSocket: ws_3 - WebSocketException during handshake
Firebase.Database.Internal.TubeSock.WebSocketException: unknown host: super-awesome-massiveproject.firebaseio.com ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.RunReader () [0x00000] in <filename unknown>:0 
UnityEngine.Debug:LogError(Object)
Firebase.FirebaseHandler:LogMessage(LogLevel, String)
Firebase.Unity.UnityLoggingService:LogMessage(LogLevel, String)
Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String)
Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level, String, String, Int64)
Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:RunReader()
Firebase.Database.Internal.TubeSock.Runnable101:Run()
Google.Sharpen.Thread:InternalRun()
mirzasohailbaig commented 6 years ago

As requested I'm reopening the issue, since it seems like something that Firebase should actually resolve.

stewartmiles commented 6 years ago

@PathToLife is there anything you can share about your reproduction environment?

Also, any chance you could try out the iOS or Android samples https://github.com/firebase/quickstart-ios/tree/master/database https://github.com/firebase/quickstart-android/tree/master/database in the same environment?

Since we have different network stacks between each environment it would be interesting to see whether the problem lies in there.

TBH The connection to the database is simply using WebSocket, I would assume that in an environment where RT DB connections are failing you would see other connections fail.

dbarla commented 6 years ago

Hello, im having the same issue. All was working fine and suddenly this started to appear. Internet is fine. Router is like always and Rules are like always.

dbarla commented 6 years ago

1/2/0001 6:01:00 PM [Error] WebSocket: ws_17 - WebSocketException during handshake Firebase.Database.Internal.TubeSock.WebSocketException: unknown host: XXXX.XXXX.firebaseio.com ---> System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network.

at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in :0 at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in :0 at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in :0 at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in :0 --- End of inner exception stack trace --- at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in :0 at Firebase.Database.Internal.TubeSock.WebSocket.RunReader () [0x00000] in :0

dbarla commented 6 years ago

Im seeing this behaviour 2 times in same day after working a little with the Database. Same machine, same Router Config,....Log with Unreachable again...what to do? I need to put this in Production and im not sure what will happen. No idea how to manage this State either. Im trying to grab "e2.DatabaseError" with no luck too. It happens 1 time out of 100 interactions. But still is annoying because the App will crash except managing this e2.DatabaseError (if i manage to understand how).

piofrey commented 6 years ago

Same for me. Accessing realtime database is working fine in most of tested networks, including mobile hotspot, except for one private network in the office, where I constantly get the following error. It doesn't matter if I try with unity editor or from a build on iOS or Android.

01/11/2018 10:08:10 [Error] WebSocket: ws_2 - WebSocketException during handshake
Firebase.Database.Internal.TubeSock.WebSocketException: unknown host: <firebase_URL> ---> System.Net.Sockets.SocketException: Connection timed out
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.RunReader () [0x00000] in <filename unknown>:0 
UnityEngine.Debug:LogError(Object)
Firebase.Platform.FirebaseLogger:LogMessage(PlatformLogLevel, String)
Firebase.Unity.UnityLoggingService:LogMessage(PlatformLogLevel, String)
Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String)
Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level, String, String, Int64)
Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:RunReader()
Firebase.Database.Internal.TubeSock.Runnable101:Run()
Google.Sharpen.Thread:InternalRun()

Accessing Firebase realtime database via CURL and pure REST API is working fine in that network. Any ideas?

EyalBira commented 6 years ago

I am getting the same issue with the router. Working fine with the mobile network and with a hotspot. Any suggestions? This might happen for users as well, making this an unreliable option...

Unity 2017.30f3 / Firebase SDK 4.4.0

TeddyMathias commented 6 years ago

Having the same issue today as @EyalBira . Unity 2017.30f3 / Firebase SDK 4.4.0. Producing "WebSocketException during handshake" error. Works with my mobile Hotspot, not working through my Spectrum internet router.

NeelimaNair commented 6 years ago

I have been encountering similar problem on multiple wi-fi networks from yesterday. Mobile hot spot works fine and I am able to connect to firebase. I get network error only for wifi connections which had been working fine till day before yesterday.

Matthewek commented 6 years ago

Any updates about this issue? Temporary disabling anti-virus on my imac helped, but that is not a solution unfortunately.

hieupt1289 commented 6 years ago

I also have same issue with Lan network but still ok with hotspot form mobilenetwork source. Anyone have solution for that, even temporary.

Matthewek commented 6 years ago

In my case it was antivirus that was blocking it (Kaspersky internet security 2017) - disabling it or, disabling "Check secure connections HTTPS" in preferences temporary fixed this issue, here is response I had from firebase tech team:

Regarding the issue, you may try using other anti virus or whitelist Firebase as our SDK doesn't work well with proxies, firewalls or anti virus, sorry for this. Here's the whitelist domain for Realtime Database:

*.firebaseio.com

Unfortunately, if your antivirus is too restrictive and chooses to block Firebase, I don't believe there's anything we can do to mitigate this at the moment.

Rest assured that we are exploring potential solutions to work this around. However, I could not guarantee anything at this time, sorry for this.

clockworkdojo commented 6 years ago

Exact same issue.

...but if I just tether off an iPhone, works just fine.

mirzasohailbaig commented 6 years ago

As it has been mentioned before this is a real issue for end users more than developers. Since developers can use a workaround to get it to work eventually, but if the end users comes across the issue they will probably not spend the time to debug it.

I'd recommend that for the time being if you must use firebase with unity, it would be in your best interest to use their rest API to connect firebase database with unity, libraries like "RestSharp" or "RestClient for Unity" make this a fairly easy process. Keep in mind even if you don't come across the issue, it is possible one of your end users will come across this issue since it is due to wireless routers and their security settings.

clockworkdojo commented 6 years ago

Well, the workaround that I just found is: TunnelBear ...I just turned on a VPN. Now it works for me... hopefully it's fixed before deployment? ...but yeah, I should just avoid the package entirely, I guess.

Matthewek commented 6 years ago

mirzasohailbaig - would you please provide any examples how to connect to the firebase using unity and rest api ?

clockworkdojo commented 6 years ago

Inexplicably, it works today. I changed nothing... has anybody had a similar experience?

mirzasohailbaig commented 6 years ago

Sorry Mattewek, I don't use firebase anymore but the details on how to make rest requests for firebase can be found here https://firebase.google.com/docs/reference/rest/database/ .

If you're using unity 2017.2 or higher I recommend using this rest client library to make it easier to write the requests. https://github.com/proyecto26/RestClient

There's one problem to this though you lose the real-time aspect of firebase by doing it this way, as far as I know.

naskardebadri commented 6 years ago

Just change the following under Player Settings: Scripting Reference Version - .Net 3.5 Equivalent Scripting Backed - Mono Api Compatibility Level - .Net 2.0

These changes helped me overcome the issue. Make these changes and just check if your issue gets solved.

Thaina commented 6 years ago

It happen to me today, but I could just solve it with resetting router

Make me feel anxious how many of my customer would face this bug

douwevdijk commented 6 years ago

Same issue here, cannot connect sometimes, very strange. I am using 5.0.4

Thaina commented 6 years ago

Today it does not work again and having problem with only ADSL connected from LAN. Switch to mobile internet with tethering make it work

I am using unity 5.6.5p4 with firebase 4.1.0

Not sure this was fixed in later version

6/4/2018 6:13:36 AM [Error] WebSocket: ws_0 - WebSocketException during handshake
Firebase.Database.Internal.TubeSock.WebSocketException: unknown host: the-soccer-game-65020269.firebaseio.com ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
  at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 
  at Firebase.Database.Internal.TubeSock.WebSocket.RunReader () [0x00000] in <filename unknown>:0 
UnityEngine.Debug:LogError(Object)
Firebase.FirebaseHandler:LogMessage(LogLevel, String)
Firebase.Unity.UnityLoggingService:LogMessage(LogLevel, String)
Firebase.Database.Internal.Logging.DefaultLogger:Error(String, String)
Firebase.Database.Internal.Logging.DefaultLogger:OnLogMessage(Level, String, String, Int64)
Firebase.Database.Internal.Logging.LogWrapper:Error(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:LogError(String, Exception)
Firebase.Database.Internal.TubeSock.WebSocket:RunReader()
Firebase.Database.Internal.TubeSock.Runnable101:Run()
Google.Sharpen.Thread:InternalRun()
criistii commented 6 years ago

Just wanted to add I am having the same issue:

Here are my scenarios:

  1. Sometimes in the editor data fails to load, after some time I am getting a Socket exception in the Unity Log. The only way to fix this is to restart my router. This happens on a wireless connection.

  2. On both iOS and Android devices, sometimes the data loads properly, sometimes it takes a very long time (2-5 minutes) until data starts loading, and other times data does not load at all. I did not find an obvious way when it happens and the fix I have is extremely unreliable: Switch to another network or data type (from WIFI to 4G or vice-versa). This is extremely frustrating because my tester cannot access the content I have.

I also don't know how I could better debug this to provide more details.

DoisKoh commented 6 years ago

I switched my router recently and I'm having the same issue with you guys. If I use my LAN card or WiFi adapter with my new router, I get the WebSocketException. If I tether to my phone (which is in turn, connected to my router - so I'm basically using my phone as a WiFi adapter), it works fine.

Thaina commented 6 years ago

Test it again and see the same weirdness

Using LAN cord will error. Using tether with phone make it work even it connect to the same router

Testing with firebase sdk 4.4 also not solve the problem. Not sure it was internal problem of firebase or unity editor itself. But on the html/js it does work normally

kicholen commented 6 years ago

Hello, I ran into the same issue with connection to realtimeDatabase.

Scripting backend version - .net 4.x Scripting backend - Mono Unity - 2018.1.2f1 Firebase Sdk - 5.0.0

samsung s6: LTE/4g is working fine - I can enable/disable phone network in top panel Android settings and reconnect to database happens almost immediate. Wifi :

Xiaomi Redmi 3: Lte/4g - does not work Wifi - does not work

SAMSUNG GALAXY TAB4 7.0: Wifi - does not work

06-07 10:18:44.853: E/Unity(1746): 06/07/2018 08:18:44 [Error] WebSocket: ws_21 - WebSocketException during handshake
06-07 10:18:44.853: E/Unity(1746): Firebase.Database.Internal.TubeSock.WebSocketException: unknown host: s-usc1c-nss-256.firebaseio.com ---> System.Net.Sockets.SocketException: Network is unreachable
kyasbal commented 6 years ago

I have same issue with .Net 4.x scripting backend. It seems caused by .Net version. But actually it is hard to change the version for my project. Is there anything better way to overvome this problem?

douglas-martins commented 6 years ago

I'm using the 5.0.0 sdk version and the error still happen. Anyone here can give me some light?

BakshishSingh commented 6 years ago

I think for now the best way to solve this issue is switch to Rest to connect to firebase RTDB and remove the Firebase package from Unity. It won't take much effort to switch to Rest and the read/write is not that slow. I recently switched my project to Rest for Firebase RTDB and removed the plugin. It works great now.

I used https://github.com/proyecto26/RestClient for rest client and followed the instructions on Firebase site to implement it

stewartmiles commented 6 years ago

Folks we're testing the native Android & iOS clients right now, hold tight and - assuming things go to plan - you'll have offline support along with native networking (we've ditch .NET networking) this week.

Thaina commented 6 years ago

@stewartmiles Would this enable firestore unity too?

stewartmiles commented 6 years ago

@Thaina no this doesn't enable Firestore. Firestore is currently being ported from Obj-C to a C++ core, once that is in place we'll use the same techniques to expose this to Unity developers. If you're versed in C++ / Obj-C and want to help move this along, I recommend checking out https://github.com/firebase/firebase-ios-sdk/tree/master/Firestore to contribute to the effort.

stewartmiles commented 6 years ago

While we can't completely close out this bug, at least on mobile (iOS & Android) the 5.1.0 release of the Firebase Unity SDK resolves this issue: Release notes: https://firebase.google.com/support/release-notes/unity#5.1.0 Download: https://firebase.google.com/docs/unity/setup

stewartmiles commented 6 years ago

BTW: We're fleshing out the C++ RT DB implementation so desktop should be able to move to a more reliable implementation soon-ish.

Thaina commented 6 years ago

@stewartmiles I wasn't good at C++ and obj-C But still interest in contribution to firestore for unity. If we would going to the wrapping path then do we have a repo for making wrapper for firestore in C# on native android and ios?

stewartmiles commented 6 years ago

Our gaming SDKs are structured like this...

iOS / Android SDK <-\
                    |--  C++ interface (cross platform) <-- Unity SDK
Desktop SDK (C++) <-/

So we build a single C++ interface that can be used everywhere, custom C++ game engines, Unreal, Cocos2d-x .. whatever you want. Building Unity --> Android / iOS only supports Unity and only supports mobile platforms.

@Thaina sure you don't want to brush up on some C/C++ ;)

VGmandeep commented 6 years ago

@stewartmiles , I was having the same issue and was looking for the solution and found your post. I have updated the firebase to 5.1.0 and now it's crashing. I am attaching the log. Regards,

` 06-25 14:20:40.952 31768 31844 E Unity : Unable to find /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

06-25 14:20:41.457 31768 31844 I Unity : Firebase App initializing app com.mycom.appname (default 1). 06-25 14:20:41.457 31768 31844 I Unity :

06-25 14:20:41.457 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:41.457 31768 31844 I Unity :

06-25 14:20:41.461 31768 31844 I Unity : Firebase Analytics API Initializing 06-25 14:20:41.461 31768 31844 I Unity :

06-25 14:20:41.461 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:41.461 31768 31844 I Unity :

06-25 14:20:41.462 31768 31844 I Unity : analytics API Initialized 06-25 14:20:41.462 31768 31844 I Unity :

06-25 14:20:41.462 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:41.462 31768 31844 I Unity :

06-25 14:20:41.712 31768 31844 I Unity : Dynamic Links API Initialized 06-25 14:20:41.712 31768 31844 I Unity :

06-25 14:20:41.712 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:41.712 31768 31844 I Unity :

06-25 14:20:41.945 31768 31844 I Unity : AF.cs setAppsFlyerKey 06-25 14:20:41.945 31768 31844 I Unity :

06-25 14:20:41.945 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:41.945 31768 31844 I Unity :

06-25 14:20:41.946 31768 31844 I Unity : AF.cs setDebugLog 06-25 14:20:41.946 31768 31844 I Unity :

06-25 14:20:41.946 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:41.946 31768 31844 I Unity :

06-25 14:20:41.988 31768 31844 I Unity : AF.cs init 06-25 14:20:41.988 31768 31844 I Unity :

06-25 14:20:41.988 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:41.988 31768 31844 I Unity :

06-25 14:20:42.114 31768 31844 I Unity : RemoteSetting Start :True 06-25 14:20:42.114 31768 31844 I Unity :

06-25 14:20:42.114 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:42.114 31768 31844 I Unity :

06-25 14:20:42.121 31768 31768 I Unity : AF.cs start tracking 06-25 14:20:42.121 31768 31768 I Unity :

06-25 14:20:42.121 31768 31768 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:42.121 31768 31768 I Unity :

06-25 14:20:42.123 31768 31768 I Unity : AF.cs trackAppLaunch 06-25 14:20:42.123 31768 31768 I Unity :

06-25 14:20:42.123 31768 31768 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:42.123 31768 31768 I Unity :

06-25 14:20:42.720 31768 31844 I Unity : Using Facebook Unity SDK v7.12.2 with FBAndroidSDK/4.33.0 06-25 14:20:42.720 31768 31844 I Unity :

06-25 14:20:42.720 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:42.720 31768 31844 I Unity :

06-25 14:20:43.226 31768 31844 I Unity : fb is not logged in 06-25 14:20:43.226 31768 31844 I Unity :

06-25 14:20:43.226 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:43.226 31768 31844 I Unity :

06-25 14:20:43.297 31768 31844 I Unity : RemoteSetting HandleRemoteUpdate 06-25 14:20:43.297 31768 31844 I Unity :

06-25 14:20:43.297 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:43.297 31768 31844 I Unity :

06-25 14:20:44.950 31768 31844 I Unity : ^^^^^^^^^^^^^^^^^^^^^^^ EU :False 06-25 14:20:44.950 31768 31844 I Unity :

06-25 14:20:44.950 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:44.950 31768 31844 I Unity :

06-25 14:20:45.288 31768 31844 I Unity : ##########################: RemoteSettings enableDB :True 06-25 14:20:45.288 31768 31844 I Unity :

06-25 14:20:45.288 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:45.288 31768 31844 I Unity :

06-25 14:20:46.539 31768 31844 I Unity : Looking up class com/google/firebase/database/FirebaseDatabase 06-25 14:20:46.539 31768 31844 I Unity :

06-25 14:20:46.539 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:46.539 31768 31844 I Unity :

06-25 14:20:46.543 31768 31844 I Unity : Class com/google/firebase/database/FirebaseDatabase, lref 0x00000000 06-25 14:20:46.543 31768 31844 I Unity :

06-25 14:20:46.543 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:46.543 31768 31844 I Unity :

06-25 14:20:46.544 31768 31844 E Unity : Java class com/google/firebase/database/FirebaseDatabase not found. Please verify the AAR which contains the com/google/firebase/database/FirebaseDatabase class is included in your app. 06-25 14:20:46.544 31768 31844 E Unity :

06-25 14:20:46.544 31768 31844 E Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43) 06-25 14:20:46.544 31768 31844 E Unity : 06-25 14:20:46.544 31768 31844 E Unity : clazz

06-25 14:20:46.544 31768 31844 E Unity : 06-25 14:20:46.544 31768 31844 E Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)

06-25 14:20:46.544 31768 31844 E Unity : 06-25 14:20:46.544 31768 31844 I Unity : Java class com/google/firebase/database/FirebaseDatabase not found. Please verify the AAR which contains the com/google/firebase/database/FirebaseDatabase class is included in your app.

06-25 14:20:46.544 31768 31844 I Unity : 06-25 14:20:46.544 31768 31844 I Unity : (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)`

VGmandeep commented 6 years ago

I have resolved it, forgot the "com.google.firebase:firebase-database" to mention in gradle, but now the issue is not consistent but it's still there. It connects to the firebase sometimes and sometimes not. still getting this error:

06/25/2018 09:59:02 [Error] WebSocket: ws_8 - WebSocketException during handshake 06-25 15:29:02.268 17824 18229 E Unity : Firebase.Database.Internal.TubeSock.WebSocketException: unknown host: wordchamp-a67b7.firebaseio.com ---> System.Net.Sockets.SocketException: Network is unreachable 06-25 15:29:02.268 17824 18229 E Unity : at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 06-25 15:29:02.268 17824 18229 E Unity : at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 06-25 15:29:02.268 17824 18229 E Unity : at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0 06-25 15:29:02.268 17824 18229 E Unity : at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 06-25 15:29:02.268 17824 18229 E Unity : --- End of inner exception stack trace --- 06-25 15:29:02.268 17824 18229 E Unity : at Firebase.Database.Internal.TubeSock.WebSocket.CreateSocket () [0x00000] in <filename unknown>:0 06-25 15:29:02.268 17824 18229 E Unity : at Firebase.Database.Internal.TubeSock.WebSocket.RunReader () [0x00000] in <filename unknown>:0

Regards,

stewartmiles commented 6 years ago

@VGmandeep if you're seeing Firebase.Database.Internal.TubeSock.WebSocketException you're likely not using the latest version of the SDK. Could you try:

eladleb commented 6 years ago

Hey @stewartmiles , I just wanted to ask if you guys have a rough estimation for the desktop C++ RT DB implementation? Is it days/weeks/months away?

I'm asking because I'm trying to decide whether to switch to a rest client but wouldn't want to make such a dramatic change unless it's necessary.

stewartmiles commented 6 years ago

@eladleb we're aiming to have the desktop implementation (for testing only) switched over this quarter (couple of months). The mobile implementation has already been migrated to the native iOS and Android SDKs which should solve all of the networking issues folks were having.

pravchuk commented 6 years ago

Upgraded to 5.1.1. Still facing this issue in Unity Editor. When I use mobile hotspot it's working fine.