Metro server does not run and not connect to the app in React Native

Viewed 1413

When I run react-native start, emulator and Metro Server does not connect to each other and when I hit r to refresh app, it say no connected app ...

enter image description here

1 Answers

Hi i had this same problem and was scratching my head for a while, it seems there was a security update in Android 9 which disabled cleartext by default.

adding android:usesCleartextTraffic="true" to your manifest in the <application> tag fixed the issue for me:

<application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:usesCleartextTraffic="true"
      ...

I found the fix in this Github issue: https://github.com/facebook/react-native/issues/23380

Related