The Android emulator opens the app but never connects to Metro or Expo
adb server version (xx) doesn't match this client (xx); killing...Short answer
When the emulator cannot reach Metro, first prove each side on its own: adb sees the emulator, and Metro listens on its port. Common causes are two adb versions fighting, ANDROID_HOME missing from PATH, port 8081 held by an old process, or a firewall on the computer.
Fix it fast
1Find out which cause you have
Check that adb sees the emulator as a device and that something is listening on Metro's port.
adb devices sudo lsof -i :80812Match what you see, then jump to its fix
- 1
adb server version (xx) doesn't match this client (xx); killing...Two adb versions are fighting each otherFix - 2
adb or emulator is not found in the terminal where you run the start commandANDROID_HOME and PATH are not set in the shell that starts the appFix - 3
Metro cannot start on its port, or the app loads an old bundlePort 8081 is held by an old Metro processFix - 4
Metro bundler ECONNREFUSED 127.0.0.1:19001Stale Expo state or a firewall in the wayFix
- 1
What does the error look like?
adb server version (xx) doesn't match this client (xx); killing...Metro bundler ECONNREFUSED 127.0.0.1:19001
Cause 1 of 4
Two adb versions are fighting each other
1Check
A second adb on your PATH (from a package manager, for example) restarts the server that the SDK copy started. Compare both versions.
which adb
adb version
$ANDROID_HOME/platform-tools/adb version2Fix
Use the SDK copy only. Put the SDK platform-tools first in PATH, or copy the SDK adb over the other one, then restart the server.
export PATH=$ANDROID_HOME/platform-tools:$PATH
adb kill-server
adb start-server3Verify
The device list shows the emulator with the word device.
adb devicesConfirmed by docs.expo.dev
Cause 2 of 4
ANDROID_HOME and PATH are not set in the shell that starts the app
1Check
The environment guide asks for ANDROID_HOME plus the emulator and platform-tools folders in PATH.
echo $ANDROID_HOME
command -v adb2Fix
Add the lines to your shell profile (macOS paths shown; use $HOME/Android/Sdk on Linux) and open a new terminal.
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools3Verify
adb prints its version from a fresh terminal.
adb --versionConfirmed by reactnative.dev
Cause 3 of 4
Port 8081 is held by an old Metro process
1Check
A previous Metro run that was never stopped still owns the port.
sudo lsof -i :80812Fix
Stop that process, or start Metro on another port.
kill -9 <PID>
# or
npm start -- --port=80883Verify
Start Metro and watch it report the port without an error.
npm startConfirmed by reactnative.dev
Cause 4 of 4
Stale Expo state or a firewall in the way
1Check
Expo names two reasons for this error: an error state kept in the local .expo folder, and a firewall or proxy on the network. The Android docs add that a firewall program on your machine can block emulator traffic.
ls -a .expo2Fix
Delete the .expo folder, then allow the Metro or Node.js process through the firewall for the emulator.
rm -rf .expo
npx expo start --android3Verify
The emulator loads the project from the dev server.
adb logcat -s ReactNativeJSConfirmed by docs.expo.dev
How do I stop it coming back?
- Keep one adb: the one from the Android SDK platform-tools.
- Stop Metro with Ctrl+C instead of closing the terminal tab.
- Keep ANDROID_HOME in your shell profile, not only in one terminal.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- TaskvareA task and project-management suite: React on the web, Flutter on mobile, TypeScript underneath.
Related fixes
Mobile apps
A React Native app on a physical phone cannot reach the Metro server
bridge configuration isn't available
A phone cannot use localhost, so a debug build must find Metro at your computer's address.
4 causes, each with a fixMobile apps
Android build stops at processDebugManifest in a React Native app
Manifest merger failed
processDebugManifest is the step that merges your AndroidManifest.xml with the manifests of every library.
2 causes, each with a fixMobile apps
React Native Android build cannot find the foojay-resolver-convention plugin
Plugin [id: 'org.gradle.toolchains.foojay-resolver-convention'] was not found in any of the following sources:
The foojay plugin is a settings plugin that Gradle downloads from the Plugin Portal.
3 causes, each with a fixMobile apps
Kotlin and Java compile to different JVM targets in a React Native Android build
'compileJava' task (current target is 1.8) and 'compileKotlin' task (current target is 11)
Gradle refuses to build when the Java task and the Kotlin task target different JVM versions.
3 causes, each with a fixMobile apps
Gradle cannot run node in a React Native Android build
Process 'command 'node'' finished with non-zero exit value 1
The React Native Gradle plugin starts node for bundling.
3 causes, each with a fixMobile apps
Axios request works on iOS or in a browser but fails on Android with Network Error
AxiosError: Network Error
A React Native app has no CORS, so on Android a Network Error usually means the request never reached the server.
3 causes, each with a fix