loremIpsum1771
loremIpsum1771

Reputation: 2527

ADB Server version doesn't match client

I'm trying to get started with Unity development for GearVR and in the setup process, I had to install and configure the Android SDK. In a tutorial, I was taken to a step where I had to use ADB to identify the signature of of my galaxy phone. I navigated to the platform tools directory of the android sdk and ran the command: adb devices, with the phone plugged in, but the command wasn't recognized.

So (in bash mode) I ran the command: ./adb devices and got the error:

ADB Server version (31) doesn't match client (36); killing
* daemon started successfully *

When I first installed Android studio, I clicked on the installation executable multiple times which started multiple installation processes and I had to cancel some of them until I was left with just one of course. Based on other SO posts like this and this it seems that there could be another version of adb installed somewhere else on the system, but I can't seem to figure out why/how I'm not able to use the command adb globally since I would have assumed that it would have been added to the PATH globally.

I've tried to use some commands in the console to find out where the other adb version might be located but I haven't been able to do so.

What could possibly be the problem here and how might I resolve it?

Upvotes: 1

Views: 7929

Answers (4)

kxkaro
kxkaro

Reputation: 41

Got this problem on Unity 2020.3.25f1 with Oculus Developer Hub on a Mac. Unity installed v4.0 while Oculus v4.1. What solved it was to remove the adb.exe from /Applications/2020.3.25f1/PlaybackEngines/AndroidPlayer/SDK/platform-tools and copy/replace it with the adb.exe from /Applications/Oculus Developer Hub/Contents/Resources/bin.

After restart Unity was able to recognize the Quest 2 device in build settings.

Upvotes: 0

Blondemonk
Blondemonk

Reputation: 31

On Windows, check Task Manager to see what adb.exe processes are running. You can right-click on one of these processes to see the location of the adb.exe file, which may show that it's running as part of an program other than the Android SDK.

In my case, I found that the Oculus Developer Hub program came with its own version of ADB, and that copying the following files from my Unity platform-tools folder (in your case, you'd want your Android SDK platform-tools folder) into the Oculus Developer Hub folder resolved the issue - you may just want to uninstall the offending software, but copying the files across should ensure that adb versions are compatible. After copying the files, I ran stopped any adb.exe processes running (using Task Manager), and then restarted Unity.

Files:

  • adb.exe
  • AdbWinApi.dll
  • AdbWinUsbApi.dll

Unity folder: /Editor/Data/PlaybackEngines/AndroidPlayer/SDK/platform-tools

Oculus Developer Hub folder: C:/Program Files/Oculus Developer Hub/resources/bin

Upvotes: 3

Hanssen
Hanssen

Reputation: 1

I got the same error when the smartphone was disconnected from Internet (wifi and mobile data). Turning wifi or mobile data on again adb devices run OK. adb devices works perfect when phone is offline few times only.

Upvotes: 0

Harry T.
Harry T.

Reputation: 3527

Your ADB is outdated. Update it by using SDK Manager. In Tools folder, download the lastest Android SDK Platform-tools then check it back.enter image description here

Upvotes: 0

Related Questions