Could not connect to React Native development server on Android

前端 未结 28 2065
鱼传尺愫
鱼传尺愫 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条回答
  •  生来不讨喜
    2020-11-30 22:42

    ** Ubuntu Try running these commands both in your root folder only:

    1. sudo npm start --- this will pause automatically after saying -- Loading Graphs, done (something like this) ; when this is done -open another terminal

    2. react-native run-android


    If still the issue prevails, delete your build folder in android / ios execute this command and then execute the above mentioned commands in the same order

    react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android**
    

提交回复
热议问题