Reputation: 3339
I build my react native app in this way :
1.npm install expo-cli --global
.
2.expo init my-new-project
.
3.cd my-new-project and expo start --lan
.
4. install expo on my ios device
.
5. open Expo then click the “Scan QR Code” and Scan the QR code in our terminal.
but I get following error :
I am connected to the same wifi on both devices and my IP is the same. And I turned off my windows firewall.
Do you know why this happens? I once saw the output on my phone but after that this error occurs every time.
Upvotes: 21
Views: 34379
Reputation: 4884
For those who is not aware of what tunnel is:
just add the --tunnel
flag in your expo start command
expo start --tunnel --port 19000
this will install ngrok & create a tunnel for you to connect via mobile easily and maintain the connection properly.
this will solve your blue screen "something went wrong" issue in expo app.
I hope it's helpful for you.
Upvotes: 0
Reputation: 2223
On my mac, I still had this issue even with the firewall disabled - it turned out that I needed to turn on Internet Sharing
in system settings.
Upvotes: 0
Reputation: 21
If someone still encountering this problem, just go to the Wi-Fi settings on the iPhone and disable the private Wi-Fi address. That will do the job!
Upvotes: 0
Reputation: 1
Try restarting your phone as well. I tried all the solutions including "expo start --tunnel". But it was not working. Then I restarted my phone. Now it's working
Upvotes: 0
Reputation: 11
As a ubuntu user I realized that ufw was blocking this port. What I did was run sudo ufw allow 8081
.
Use that command with your expo port or simply but more insecure, run sudo ufw disable
.
Upvotes: 1
Reputation: 352
You have to make sure all of these list items are done:
Upvotes: 0
Reputation: 1142
node
:
node
in the list of application rules, click on it, and then
click the -
button to remove it.node
.npm run start -- --tunnel
Upvotes: 0
Reputation: 361
I had the same problem, entered to Settings
, Network
, Wi-Fi
, Show Available Networks
, Properties on your internet connection
, and click on Private
. Then it worked, I hope it serves to you too.
Upvotes: 26
Reputation: 1658
In my case there was a VPN connected. Make sure you're using the same local network in order to use LAN option for expo.
Upvotes: 0
Reputation: 61
None of the posted solutions were fixing the problem, this is what ended up doing the trick:
System Preferences ->
Security & Privacy ->
Firewall (tab) ->
Firewall Options... (button) ->
scroll down to node in the left column and change the corresponding dropdown to read 'Allow incoming connections'
I then closed out the previously opened server in my terminal, turned off the wifi connection on both of my devices.
Once I ran everything again and scanned the new QR in my terminal, the app loaded.
Upvotes: 6
Reputation: 31
Your firewall is most likely the problem. It may be blocking your phone's connection to your computer.
On Windows: Settings > Network and Internet > [Ethernet || WiFi] > Network > Network Profile [Private] > Configure Firewall and Security Settings > (Settings is trying to open Windows Security) [Yes] > Private Network > Microsoft Defender Firewall [Off]
Now expo should work through LAN.
Alternatively: On the expo developer tools, switch to tunnel.
Upvotes: 3
Reputation: 1695
I had this problem on an iPhone - it was working fine for at least a month until suddenly it couldn't connect. It could still connect using the 'tunnel' option, but not LAN.
Interestingly, the iPhone COULD connect to a different PC, and at the same time a different device could connect to Expo on the machine that was problematic for the iPhone.
After trying lots of other things, I uninstalled and re-installed Expo Go app on the phone and it started working again.
Upvotes: 0
Reputation: 46
I had the same problem. I disconnected from my wifi network, reconnected and it started working.
Upvotes: 1
Reputation: 641
I was having having the same issue. Switched to tunnel
connection and it worked.
Upvotes: 31
Reputation: 187
I had this problem as well and was able to solve it. If you have a program like docker installed, it will create a virtual network adapter, Expo will then try to use this virtual network adapter to host the app. You want Expo to use your physical wifi/ethernet adapter in your computer instead, since that will allow it to communicate with your phone (which is on the same network).
You can solve the problem by changing the adapter properties to ensure that Expo uses the right network adapter to host your development environment:
Restart your Expo server and try again once you complete the steps in the link above.
Upvotes: 8
Reputation: 3690
I think you should scan the QR code from the dev tools that run on localhost from browser. Also the Expo app in Ios doesn't have a scan QR code option, if I am not wrong. We run apps by scanning QR code directly from Camera and opening it using Expo app. From my personal experience the QR code shown in terminal causes problems as we save changes to app.
Upvotes: 0