Expo, java.net.SocketTimeoutException:failed to connect

Viewed 2229

am new to React native Expo I need to add some new modules on my project. "expo": "33.0.0", "react": "16.8.3", whenever I try to run my project am getting Error am not able to run the project. I tried all way to run the project like set REACT_NATIVE_PACKAGER_HOSTNAME='192.168.0.102', firewall off, allowed inbound 19000 port etc. but am getting error.

when I enter expo start -c

 Your project may not work correctly until you install the correct versions of the packages.
To install the correct versions of these packages, please run: expo install [package-name ...]
Starting Metro Bundler on port 19001.
Your JavaScript transform cache is empty, rebuilding (this may take a minute).
Your native app is running at exp9c305c55e38f4d0e856f59397620314e://192.168.0.101:19000
Logs for your project will appear below. Press Ctrl+C to exit.

then my laptop and mobile is connected with same network and same IP but am getting error and i don't know the port 19000 is different from my wifi

Uncaught Error:java.net.SocketTimeoutException:failed to connect to/192.168.1.20(port 19000)from/192.168.0.102(port 49615) after 10000ms

Please give some solution for it.

3 Answers

it's fail because port 19000 is not open in your firewall if you use linux OS open this port by sudo ufw allow 19000/tcp

enter image description hereFirst Check are you in tunnel connection? If you are in tunnel connection then

First : ipconfig

then : set REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.103 (IPv4 Address)

then:npm start

It worked for me. Hopefully it will help.

I resolved this by changing the network profile on the connected wifi from private to public.

Expo Error Fix

Related