question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not connect to development server after updating react-native.

See original GitHub issue

I’m trying to update from react-native 0.55.4 to react-native 0.58.3.

The issue I’m facing is that my app cannot connect to the metro bundler. Despite adb reverse, the emulator as well as a physical device cannot connect to it. I can open the URL just fine in the chrome browser of the device, but the app can’t connect to it.

I have followed the update notices in the changelogs, resulting in the following package.json:

"dependencies": {
    "react": "16.6.3",
    "react-native": "0.58.3"
  },
  "devDependencies": {
    "babel-jest": "^23.4.2",
    "metro-react-native-babel-preset": "^0.45.0",
    "jest": "^23.5.0",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }

I have left out the unimportant packages.

I have also changed the .babelrc file to:

{
  "presets": ["module:metro-react-native-babel-preset"]
}

Environment info:

React Native Environment Info:
    System:
      OS: Windows 10
      CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz
      Memory: 3.21 GB / 15.93 GB
    Binaries:
      Yarn: 1.7.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
      npm: 6.1.0 - C:\Program Files\nodejs\npm.CMD
    IDEs:
      Android Studio: Version  3.3.0.0 AI-182.5107.16.33.5264788

Any help would be much appreciated.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:18

github_iconTop GitHub Comments

243reactions
hackdiecommented, Mar 18, 2019

@hackdie What did you do?

add android:usesCleartextTraffic="true" to your application, in the manifest

<application
       ....
       android:usesCleartextTraffic="true"
       android:theme="@style/AppTheme">
35reactions
luigimannonicommented, May 24, 2019

Also had this problem on Android 9 on a simulator, fixed by adding android:usesCleartextTraffic="true" as @hackdie explained in the comment above and also I had to reroute the application on localhost:8081 by opening the in-app menu (CTRL-M on Linux / CMD-M I guess on iOS) and then Dev Settings > Debug server host & port for device > localhost:8081, close the dialog, fully close the app on the simulator and relaunch it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not connect to React Native development server on ...
Open the in-app Developer menu. shake your phone or press CMD/ctrl + M · Click on Settings · click on Debug server host...
Read more >
Could not connect to development server : ReactNative
Connection of multiple devices: Enter adb devices command your terminal to a check the list of connected devices. · Run the react server...
Read more >
Solve Could not connect to development server ... - SKPTRICKS
How to Solve Could not connect to development server Error in React Native : Step 1 : Cancel the current process of "react-native...
Read more >
Could not connect to React Native development server on ...
Android : Could not connect to React Native development server on Android [ Beautify Your Computer ...
Read more >
Troubleshooting - React Native
You will also need to update your applications to load the JavaScript bundle from the new port. If running on device from Xcode,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found