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

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

提交回复
热议问题