Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native app does not start in Expo app

I have HTC M8s with Expo installed on which I want to test my apps written in React Native. I run my app in a console, scan QR code and try to connect to my app from my smartphone - unfortunately, I see an error saying that it could not load exp://myaddress:port.

I am using Windows 10 and both my PC and my smartphone are connected to the same WiFi network.

Here's the result of ipconfig command:

Ethernet adapter Ethernet:
   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : myhostname.net

Wireless LAN adapter Wi-Fi:
   Connection-specific DNS Suffix  . : myhostname.guest
   Link-local IPv6 Address . . . . . : fe80::8136:d112:d190:5fd8%17
   IPv4 Address. . . . . . . . . . . : 10.168.4.171
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 10.168.4.1

Ethernet adapter Ethernet 6:
   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter Local Area Connection* 1:
   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet 3:
   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Bluetooth Network Connection:
   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Local Area Connection* 11:
   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::1c40:2198:f557:fb54%11
   Default Gateway . . . . . . . . . :

Here's the result of running npm start:

(...) Or enter this address in the Expo app's search bar:

  exp://10.168.4.171:19000

Unfortunately, I can't access my app from Expo app installed in my smartphone.

I already tried:

  • Uninstalled VirtualBox on my PC
  • Changed the priority of network adapters so that WiFi has the highest priority

And I am still unable to run my app via Expo app. However, installing Expo app on my PC solved the problem - it shows different QR code than the one on console and I can run my react native app, but I would like to run my app from Expo app from my smartphone.

EDIT: I tried on another PC with Win10. Installed create-react-native-app, ran it and it worked perfectly through WiFi.

like image 325
TheOpti Avatar asked Dec 20 '25 04:12

TheOpti


1 Answers

Source: https://github.com/react-community/create-react-native-app/issues/60#issuecomment-317104728 I read Himujjal's solution and it works with me: The following steps will definitely help. I had the same problem and was able to solve it in my Windows 10 OS. I had Virtual Box installed on my computer and I was not able to run CRNA in my android expo client. So,

  1. first I connected my laptop through my mobile hotspot.
  2. Then Control Panel > (search for 'network connections') > network connections
  3. Right-Click on 'Wifi' > select 'Properties' > 'Internet Protocol Version 4 (TCP/IPv4)' [don't uncheck the mark]
  4. Go to "Properties" > "Advanced..." > (Uncheck 'Automatic Metric') > Type in the text-box below that (Interface Metric) : 10.
  5. Click OK and OK and OK :)
  6. Then do the same for the other "Virtual Box-xxxxx" networks. But instead put 20 in the Interface Metric text-box.
  7. Click OK, OK and OK.

Try restarting your app on Expo. It must work now!

like image 68
Tarek El-Mallah Avatar answered Dec 21 '25 18:12

Tarek El-Mallah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!