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

后端 未结 26 1642
后悔当初
后悔当初 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:28

    You Just need to open the port in Window Firewall and everything should work.

    1.On the Start menu, click Run, type WF.msc, and then click OK.

    In the Windows Firewall with Advanced Security, in the left pane, right-click Inbound Rules, and then click New Rule in the action pane.

    In the Rule Type dialog box, select Port, and then click Next.

    In the Protocol and Ports dialog box, select TCP. Select Specific local ports, and then type the port number of the instance of the React port, such as 19000 for the default instance. Click Next.

    In the Action dialog box, select Allow the connection, and then click Next.

    In the Profile dialog box, select any profiles that describe the computer connection environment when you want to connect to the Database Engine, and then click Next.

    In the Name dialog box, type a name and description for this rule, and then click Finish.

    Similarly you can open port 19001 too.

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

    I had done everything mentioned in context. Just Changed my connected WiFi network from public to private. This Worked for me

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

    If you have tried everything, and still not working for you. Change the Connection to 'Local' instead of 'LAN', it is working perfectly for me. It is not the best solution but does the work.

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

    I suggest you install expo application for react native, link to official guide here

    npm install -g exp
    

    Then you can use Genymotion software to emulate different environment setting for your app an run:

    exp start
    

    If you use in the terminal "npm start" with native react, the following is for you. I found out that if my application runs successfully IpV addresses of my computer, that are shown in the terminal and that is on Expo app are identical, for example:

    ipconfig -> IPv4 Address. . . . . . . . . . . : 10.0.0.124
    exp://10.0.0.124:19000
    

    Based on this observation I solved this issue by the following way:

    1. Close npm prompt script which is running app
    2. Close Expo app
    3. Find your IP by running command in the terminal:

      ipconfig
      
    4. Run command in NodeJS command prompt with your IP (for example 10.0.0.124)

      set REACT_NATIVE_PACKAGER_HOSTNAME=10.0.0.124
      
    5. Start Expo app, scan barcode

      npm start
      

      If it does not help, then use next steps recommended by React developers in addition to other reasonable efforts:

    6. Install Genymotion with VirtualBox
    7. SignUp at Genymotion site
    8. Run Genymotion software and !!!SignIn
    0 讨论(0)
  • 2020-12-02 10:31

    One of the simplest and 100% working solutions is:

    1. Enable the Mobile Hotspot of your development machine( PC or Desktop ) and connect your Android device with this hotspot.
    2. Goto Control Panel > Network and Internet > Network Connections You will land in here as shown:Network Connections setting
    3. Then set the IP address of Local Area Connection(Your DESKTOP HOTSPOT) to a desired one, say: 192.168.1.69 by right-clicking on the concerned connection and then clicking on properties -> Internet Protocol Version 4(TCP/IPv4) -> Properties. Then set the priority of this connection to be the highest and this is best described here
    4. Then open a command terminal and run:

      set REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.69 (Windows)
      REACT_NATIVE_PACKAGER_HOSTNAME=192.168.1.69 (Mac & Linux)
      
    5. Then restart your expo server by running npm start in your expo project folder and run the app on your Android device by scanning the generated QR code with the expo app.
    0 讨论(0)
  • 2020-12-02 10:32

    I wasted my whole day searching for answer and finally i got solution accidentally. Just change connection from LAN to tunnel

    Below is the image,

    0 讨论(0)
提交回复
热议问题