Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

The Android emulator opens the app but never connects to Metro or Expo

Erroradb 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.

  • Applies to React Native 0.76, Expo SDK 54, Android Studio current stable, Android Emulator 36
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 :8081
  2. 2Match what you see, then jump to its fix

    1. 1adb server version (xx) doesn't match this client (xx); killing...Two adb versions are fighting each otherFix
    2. 2adb 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. 3Metro cannot start on its port, or the app loads an old bundlePort 8081 is held by an old Metro processFix
    4. 4Metro bundler ECONNREFUSED 127.0.0.1:19001Stale Expo state or a firewall in the wayFix

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 version

2Fix

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-server

3Verify

The device list shows the emulator with the word device.

adb devices

Confirmed by docs.expo.dev

Did this fix it?

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 adb

2Fix

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-tools

3Verify

adb prints its version from a fresh terminal.

adb --version

Confirmed by reactnative.dev

Did this fix it?

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 :8081

2Fix

Stop that process, or start Metro on another port.

kill -9 <PID>
# or
npm start -- --port=8088

3Verify

Start Metro and watch it report the port without an error.

npm start

Confirmed by reactnative.dev

Did this fix it?

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 .expo

2Fix

Delete the .expo folder, then allow the Metro or Node.js process through the firewall for the emulator.

rm -rf .expo
npx expo start --android

3Verify

The emulator loads the project from the dev server.

adb logcat -s ReactNativeJS

Confirmed by docs.expo.dev

Did this fix it?

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:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.