Android Emulator:adb server version (xx) doesn’t match this client (xx)

Published on:
Last updated:

This post is also available in: 日本語 (Japanese)

I'm using an Android device or emulator, and when I try to debug build, I encountered the following error, so I'm leaving a memo as a notebook.

adb server version (41) doesn't match this client (40); killing...

The error message seems to be that the version of the adb server in the local development environment does not match the version of the adb server used by the Android device or emulator(such as Genymotion).

Workaround #1.Stop and restart the adb server

The command to stop the adb server is

adb kill-server

And the command to start the adb server is

adb start-server

Alternatively, you can also use the "adb devices" command to start the adb server when it is stopped.

Workaround #2.Doubt that Android SDKs may be using different ones

Personally, the above method did not solve the problem, so when I delved into it, the Android SDK used in the local development environment and the Android SDK used in the Android emulator(such as Genymotion) were different.

So, I unified the PATH of the Android SDK used in this project and stop/restart the adb server to solve the problem.

The following are possible cases where the Android SDK is running on a different version, so it is necessary to unify the PATH of the Android SDK used in the current project.

- Android SDK derived from Android Studio
- Android SDK that is in the PATH with an Android emulator(such as Genymotion)
- Android SDK derived from Android SDK(command line tool) installed by itself

Finally, you need to stop/restart the adb server.

No tags for this post.

About
Kuniyoshi Takemoto is the founder of Amelt.net LLC, and editor of this blog(www.amelt.net).Learn more and follow me on LinkedIn.