Getting a Timeout Error connecting Expo client to my app

Using the expo client app to connect to my app on the pc via the QR code. I get the following error in the expo client app:

Uncaught Error: java.net.SocketTimeoutException:timeout 14.50.53 Fatal Error

My phone is connected to the same wireless network as my pc. I assume it’s some sort of network setting somewhere, no idea what though. Other devices on the same network connect and interact on the network fine.

I have a similar issue but only when viewing on Android emulator or when viewing on real device. Both tunnel and lan doesn’t work.

When I click to view the logs it says java.net.SocketTimeoutException: timeout.

But it works well on iOS simulator though.

Note that this only started happening after upgrading to expo 38.

I’ve just tried to run it via connecting my phone via usb debugging and it’s throwing a similar error:

Uncaught Error: java.netSocketTimeoutException:timeout 16:41:54 Fatal Error.

But when I try to visit ip:19000 directly on Android emulator chrome it does return the json but it takes awhile and that explains the timeout. The client is just not waiting enough, is there a way to increase client timeout?

Btw I also tried creating new bare project from scratch and I can confirm it also loads prolly because there’s not much dependency that the json file is smaller and returns faster.

Oh this is funny, after running that bare project I switched to my actual project and run it again and now I don’t get a timeout and my app starts loading on Android emulator again.

It feels like a cache of sorts got reset that it started working again. Weird, but at least I’m good for now.

Didn’t work for me, unfortunately. People have been reporting this problem for months in Google Play, pretty poor that the developers won’t fix it.

You just need to switch to private from public (your pc wifi settings) which makes your pc/network discoverable.

1 Like

You can effectively handle it by define a connection timeout and later handle it by using a try-catch block. From the client side you can use the following method and set the timeout parameter:

clientSocket.connect(SocketAddress,timeout)

From the server side you can use the following method and set the timeout parameter:

serverSocket.setSoTimeout(timeout)

Also, if you are a programmer, you can surround the socket connection part of your code in a java try/catch/finally and handle the error in the catch. You might try connecting a second time, or try connecting to another possible socket, or simply exit the program cleanly.

La solucion
(Solving Network Response Timed Out when Using Expo on Windows | by Colin Hobday | Medium)

This works!, you need to change the network in your computer to private

here’s a link on how to do it: Make a Wi-Fi network public or private in Windows - Microsoft Support

It worked for me, there’s a very good chance It will work for you!

I tried to run on different ports. WI-FI network is public, still doesn’t work.

Thank you, it worked here :grinning: