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

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

    in Windows

    1. run the ipconfig in command prompt

    2. get the ip4 address and copy it.

    Than go to

    1. This PC > properties > advanced system settings > environment variables
    2. add the following system variable: REACT_NATIVE_PACKAGER_HOSTNAME
    3. As the value for the variable I had to paste the ip4.

    then run the npm start It's work for me

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

    This issue could possibly be resolved by:

    Setting your environment variable with alternative instructions here

    Or

    Assigning interface matrix priority for your network adapters with detailed instructions here or here.

    Or

    An Ubuntu machine is unable to open a port

    After you make any changes, please restart the computer before testing if it works.

    Good luck!

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

    In my case, this problem occurred because Expo android app need "draw over other apps" permission and I didn't give it. So I give this permission to Expo app and the problem solved..

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

    Solution 1:- Connect both(your PC and mobile)with same network then scan the QR with expo application.

    Solution 2:-Select / change connection type as Tunnel mention in local host development window of your browser then scan the QR with expo application.

    I think this will help :)

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

    If you are using git bash for development then this solution by Icruz4 will help

    Instead of

    set REACT_NATIVE_PACKAGER_HOSTNAME

    Use:

    export REACT_NATIVE_PACKAGER_HOSTNAME='192.168.1.123'
    

    Note:

    When you run

    npm start

    Expo tells you in the output the IP it's using. If that IP is not the IP you want then the

    REACT_NATIVE_PACKAGER_HOSTNAME

    environment variable is not set properly

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

    In Windows,

    set REACT_NATIVE_PACKAGER_HOSTNAME=my-ip-address
    

    worked inside my git bash terminal, but not cmd. In git bash, after I ran npm start, I got a firewall popup, which I clicked allow and it worked!

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