React Native: Could not connect to development server

Venkat.R
Error Healer
Published in
2 min readFeb 14, 2018

If you are a beginner to React Native then you would have faced this issue at least once. React Native connects with Emulator after Metro generate the build to serve Emulator. below is command which triggers the above process.

react-native run-android // Connect with Android Device or Emulator
react-native run-ios // Connect with IOS Device or Emulator

Lets take simple example with android, the above command run the below shell script which is part of React Native where its actually validate android SDK, Environment and device if exist.

https://github.com/facebook/react-native/blob/0.54-stable/scripts/run-android-local-integration-tests.sh

android-local-integration-tests.sh

Error: Emulator throws the error “Could not connect to development server” and below is the screenshot.

Could not connect to development server

Solution

Basically this error tells that your current build got failed due to reasons like Code issue or dependency issue.

In order to fix this issue, solution is dead simple is below.

  1. Cancel the current process of“react-native run-android” by CTRL + C or CMD + C
  2. Close metro bundler window command line which opened automatically.
  3. Run the command again, “react-native run-android”

Cool, Isn’t it !!

Happy Coding, Stay tuned for next error with solution !

--

--

Venkat.R
Error Healer

👨‍💻 React, Full Stack Engineer | Father | Career Coach | Mentor | 📗 Blogger | Ex-Yahoo, Visa, Target, Proximus— webslate.io