Could not connect to React Native development server on Android

前端 未结 28 2002
鱼传尺愫
鱼传尺愫 2020-11-30 22:10

When I run react-native run-android, it gives me the following error:

Could not connect to development server

28条回答
  •  Happy的楠姐
    2020-11-30 22:31

    When I started a new project

    react-native init MyPrroject
    

    I got could not connect to development server on both platforms iOS and Android.

    My solution is to

    sudo lsof -i :8081
    //find a PID of node
    kill -9 
    

    Also make sure that you use your local IP address

    ipconfig getifaddr en0
    

提交回复
热议问题