Error: adb server version doesn’t match this client in Android
You may face error “adb server version doesn’t match this client” during working with Android application using Android Studio or Xamarin.Android (or Xamarin.Forms) Application using Visual Studio.
and error may be display as follow:
adb server version (40) doesn't match this client (41); killing... ADB server didn't ACK
The Possible Reason: Multiple Version of adb.exe installed in the system.
Here I give you possible solutions to solve the error: “adb server version doesn’t match this client”.
Open your Command-Line ( Windows + R => type cmd=> Enter for Windows os) or Terminal and execute
Check if any path contains “android-sdk\platform-tools” or not. If not then you need to set Environment variable Path for adb.
How to Set Environment Variable- Path?
To set an Environment Variable Path, you need to follow the following steps:
- Right Click on My Computer / This PC -> Go To Properties
- Select Advanced System Setting
- Select Environment Variables…
- Select Path Variable from System Variables List and Click on Edit.
- Add Semicolon (;) at the last of the Path String and add your custom path.
In our case, we need to set Path for adb in Path Variable.
Search adb.exe to get the Path for adb. If you are using Android (Java Platform) the Path might be “C:\Users\USERNAME\AppData\Local\Android\Sdk\platform-tools”. and If you are using Xamarin.Android or Xamarin.Forms then Path might be “C:\Program Files (x86)\Android\android-sdk\platform-tools”.
Set the Environment Path Variable according to adb.exe path. After this process, we need to reopen the Command-line (or CMD) and execute the following command:
– I am using Xamarin.Android for Android App.
Now you can run Android Studio or Visual Studio to Check if Error is Solved or not.
If you have still the same error, the possible reason is another adb.exe is already running from a different location.
How to check adb.exe is running or not?
To Check whether another adb.exe is running or not you need to open Task Manager and check for adb.exe.
If adb.exe is there you need to right-click and then go to properties. Check the location of adb.exe.
If you adb.exe location path from Task Manager and adb.exe Path from your “adb version” command output is different then that is the reason for the error.
Update your Environment Path Variable Path for adb.exe to adb.exe location path from Task Manager. You need to set ADB Environment Variable as well to this new Path.
How to set the environment variable ADB (which is read by scrcpy)?
In a shell (typically on Linux), you can set the variable for a single command:
On Windows, you can set it globally in Windows preferenced, but you can also set it locally:
set VAR=value command
If you are using a Windows system then execute following command in CMD:
– You must use the full path to the adb.exe
That’s all done.
Again you need to execute “adb version” command on command-line and check the version and Path for your adb.exe
Here is the Checklist for the entire process:
- Check Path for adb.exe is already set in Path Variable or not.
- Check if any another adb.exe is already running or not
- check the adb.exe version using “adb version” command
- Set Path for ADB variable using command-line
Note: Make sure that Path for your adb.exe must be the same in all the case.
Now restart you Android Studio or Visual Studio and Run the Application.
Hope this will Helps. Enjoy your day! Please like and Share if you really like this.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?