Jan D.M.
Jan D.M.

Reputation: 2672

SocketTimeOutException with Expo

I tried to test my first app on my Android phone, but after scanning, I receive the following error message:

" Uncaught error: java.error.sockettimeoutexception: failed to connect to 192.xxx.x.xx (port 19000) from 192.xxx.x.xx (port 45513) after 10000ms "

I already tried to open the firewall settings for port 19000, but that does not seem to be the problem, because it is not fixing my problem. I also closed the virtual network from virtualbox.

Can someone help me?

Upvotes: 7

Views: 8402

Answers (4)

mmd amin
mmd amin

Reputation: 887

To solve this problem try:

  1. Change your network profile to private.
  2. Disable windows firewall or add new rule for port 19000.
  3. If you have any antivirus software allow port 19000 as well.
  4. Open cmd and enter ipconfig. You should see a list of your networks. Your network ip address (highlighted in picture) should match the one that expo showing on start up (highlighted in picture). If these ip addresses don't match together then try disabling all other networks form Control Panel > Network and Internet > Network Connections, or you could try setting REACT_NATIVE_PACKAGER_HOSTNAME={your_ipv4_ip_address}. your_ipv4_ip_address in my case is 192.168.1.33 (picture)
  5. Increase your networks priority from Control Panel > Network and Internet > Network and Sharing Center > "Select your active network" > Properties > "double click" Internet Protocol Version 4 > Advanced > uncheck Automatic Metric and enter number 10 or higher in text field.
  6. On Android phone go to Settings > Apps > Expo Go > in advanced section set "Apps that can appear on top" status to on.

An alternative solution that is much slower is choosing tunnel connection.

Upvotes: 0

MorZa
MorZa

Reputation: 2325

On the localhost - try to change the connection from LAN to Local.

Upvotes: 1

Wafa Bergaoui
Wafa Bergaoui

Reputation: 61

I solved my own problem: Just i disconnect my pc and my mobile of internet. And after that my app was lanched in my device, then i reconnect them with the same internet to test my app.

Upvotes: 1

Jan D.M.
Jan D.M.

Reputation: 2672

I solved my own problem: I just needed to change my wifi settings from public to private in Windows. After changing this, it worked for me.

Upvotes: 14

Related Questions