I am trying to run create-react-native-app on expo app in android.
Firstly ,I created the project by writing command
create-react-native-app t
You can get around that by fixing your laptop's ip address to a static ip, let's say 192.168.1.69, then you need to change the react native packager ip address to the same of your laptop, using
set REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.69 (Windows)
REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.69 (Mac & Linux)
start your project again and you're good to go.
It might sound very naive. But just restarting my machine solved this issue.
I tried many solutions, only this way helped me to solve this problem:
In Windows:
In my case the firewall settings alone didn't do it. My issue was that VirtualBox network devices were taking priority and the Expo host was starting on the wrong network.
On windows you can run ipconfig
and look at the network adapters you have. npm
/yarn start
seems to take whatever shows up first in that list.
I found out about this from here: https://github.com/react-community/create-react-native-app/issues/60
If you don't need the other network adapters in the list, you can disable them in the Network Connections interface of the Control Panel.
If you need to use those connections and have Expo work then to solve the issue I followed this process:
- Goto Control Panel > Network and Internet > Network Connections
- Right click the desired connection (Higher Priority Connection)
- Click Properties > Internet Protocol Version 4
- Click Properties > Advanced
- Uncheck 'Automatic Metric'
- Enter 10 in 'Interface Metric'
- Click OK
Repeat for the Lower Priority Connection, but this time put 20 into the 'Interface Metric'
You'll now use the higher priority connection as a default.
sudo exp start
it will ask you your expo account login details once you done with this.