When I run my expo/react-native project and want to run it on my android phone through the expo go app, it gives me a connection error:
"Uncaught Error: java.net.SocketTimeoutException: failed to connect to /192.168.2.18 (port 19000) from /192.168.2.9 (port54394) after 10000ms"
- windows 10
- node v16.18.1
- expo 46.0.9
- react-native 0.69.6
From help from multiple resources I've tried the following things, but nothing worked:
- made sure phone and laptop are on same network
- Add inbound rule in windows firewall to allow port 19000
- disabled windows firewall
- Changed network profile to Private.
- set REACT_NATIVE_PACKAGER_HOSTNAME to the ipv4 address
- run
expo start --tunnel
, this works. But not the best solution because it slows everything down - Connected phone through USB to laptop. Developer mode is on, enabled USB debugging and tethering.
- run
sudo ufw allow 19000/tcp
- entered "10" as interface metric for Internet Protocol Version 4
- removed .expo to clear cache(?)
- I also have a mac, if I run it on there it works and can connect to it / open the app just fine.