Network Response Time Out Error (create-react-native-app) (expo)

后端 未结 26 1641
后悔当初
后悔当初 2020-12-02 10:00

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

相关标签:
26条回答
  • 2020-12-02 10:21

    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.

    0 讨论(0)
  • 2020-12-02 10:21

    It might sound very naive. But just restarting my machine solved this issue.

    0 讨论(0)
  • 2020-12-02 10:25

    I tried many solutions, only this way helped me to solve this problem:

    In Windows:

    • go to "Network and Connections" in Control Panel of windows (Network and Sharing Center>Change Adapter Setting)
    • Disable all virtual boxes which you can see here
    • Restart npm or yarn or expo...
    0 讨论(0)
  • 2020-12-02 10:26

    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:

    1. Goto Control Panel > Network and Internet > Network Connections
    2. Right click the desired connection (Higher Priority Connection)
    3. Click Properties > Internet Protocol Version 4
    4. Click Properties > Advanced
    5. Uncheck 'Automatic Metric'
    6. Enter 10 in 'Interface Metric'
    7. 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.

    0 讨论(0)
  • 2020-12-02 10:26
    • Found ipv4 address
    • open expo app then tap to explore button from bottom
    • write exp://[ipv4adress]:19000 to searchbar
    • Then your app will open
    0 讨论(0)
  • 2020-12-02 10:28
    1. In your device: Log in to your expo app, create account if you doesn't have any.
    2. In you system: open terminal go to you project directory via cd command and then type sudo exp start it will ask you your expo account login details once you done with this.
    3. It will gives you qr code to scan.
    0 讨论(0)
提交回复
热议问题