Reputation: 904
I'm using Expo App in my Android Device to connect into the my Laptop's Expo (Signed in both my same Expo's Account)I am also connected in the same network. Then I scanned my code then after that it is unable to connect it. This is the error:
Uncaught Error:java.net.ConnectException: Failed to connect to localhost/178.0.0.1:190000
There is also an eror that I get in my Expo's Laptop:
Sometimes the URL is not the same. It should be same, right? How do I solve this. Thank you in advance!
Upvotes: 21
Views: 44967
Reputation: 661
Restarting my (linux) computer made the connection work again.
Hopefully saving someone else a few minutes with this unsatisfying yet classic answer.
Upvotes: 0
Reputation: 441
First install expo
npm i expo
then run npx expo start --tunnel
Upvotes: 0
Reputation: 235
Try to connect it with your mobile network as it is private network, Or try after change your wifi access to private. This will work for me. And once change your network please restart the server for get new connection.
Upvotes: 1
Reputation: 2923
I upgraded my Expo SKD from 46 to 47 and my Android Expo Go, testing dev environment now works.
From my local project terminal, (MacOS Monterey, using VS Code) I ran this:
yarn add expo@^47.0.6
As of Expo Go Client version 2.29.1, Only SDKs 47, 48, 49 are supported.
-- Be sure to only upgrade Expo SKD Client versions one at a time, (DO NOT Skip versions, e.g. go from say 46 to 48).
Sourced: Upgrade Expo SDK -- (Link to Blog post for version 47 upgrade, recommends upgrading expo-cli with npm but since version 46 expo-cli was incorporated into expo and no longer installed globally but locally, I went with the above yarn add/update which worked like a charm.)
Upvotes: 0
Reputation: 27
I don't why these answers are too complicated, I have very easy solution for this.
Try running your computer and mobile on same WI-FI network.
After executing the App.
just use EXPO app and try entering URL manually ..
URL should be exp://your_systems_IPv4_address:your_port
your_systems_IPv4_address : it can be in the format 192.168.0.1
port: it can be 19000 or 19001....
Thanks
Upvotes: 0
Reputation: 11
npx expo start --tunnel
In my case, solved with option --tunnel
https://docs.expo.dev/more/expo-cli/#server-url
Upvotes: 0
Reputation: 71
Upvotes: 2
Reputation: 1
tunnel is still your best bet if you ask me. i just fixed this same error using tunnel. and how to do it is very simple. go to your package json and where you have expo start add --tunnel to it, so it would look some thing like this: "script" : { "start" : "expo start --tunnel" } that would surely fix your issue, you can then use expo start -- tunnel or npm start, whichever you prefer
Upvotes: -1
Reputation: 154
I was using a previous link like 172.something but now on my new network the expo link was like 192.something, so realizing changed networks and using correct link helped me.
Upvotes: 0
Reputation: 51
environment variable doesn't work for me, npx expo start --tunnel
is useful
Upvotes: 5
Reputation: 209
If you're using WSL(Windows Subsystem for Linux) like me and trying to run expo go via QRcode you generated in WSL; give it a try the same process in your Windows PowerShell. I applied the same steps and it worked this time.
Upvotes: 0
Reputation: 9
I solved my issue by deleting the eas.json file. Now expo app is working fine.
Upvotes: -3
Reputation: 582
I had this problem with the newest expo-cli version (6.0.1), which does not seem to have the "tunnel" option anymore. The funny thing is that the device sometimes connects, but frequently not.
I downgraded to v5.5.1, and could connect again using the tunnel option.
Upvotes: 0
Reputation: 1
To solve this issue follow these steps:
Upvotes: 0
Reputation: 453
For those who are using physical android device via cable, try to activate USB tethering
on android and set the expo connection to local
. It works for me. Hope it help someone in the future.
Upvotes: 2
Reputation: 1907
In my case the problem was in my phone, which didn't connect to same wifi, but instead used mobile internet. To check it you use modem mode on your phone and connect your computer by wifi to it. In this case you can be sure both devices connected via same net, and I hope it may solve the problem.
Upvotes: 3
Reputation: 101
If you're using Windows, make sure the network you are using is configured as a Private network. If it's set as a Public network, you will not be able to connect.
Upvotes: 10
Reputation: 1789
Steps I followed that solved my issue
expo start
and everything working good nowUpvotes: 3
Reputation: 1
I solved this issue by connecting the physical phone(That you are using to connect with the App) hotspot with the laptop instead of another Wifi.
Upvotes: 0
Reputation: 481
First off make sure to turn off all of your anti-virus software including anything that has firewall protection. You have to do this on both your computer and your phone. It can be kind of a pain in the butt
Then try using the "Tunnel" connection for the type of connection. I had the same problem and that's how I finally got it to work on my phone.
Upvotes: 36