Reputation: 14342
Whenever I try to run adb devices
:
$ adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
HT0ANRV05740 device
It says daemon is not running and restarts the daemon.
Then, if I run adb devices again, it does the same thing -
$ adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
HT0ANRV05740 device
Then, if I run it again, it again does the exact same thing -
$ adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
HT0ANRV05740 device
Please help!!
Also, my DDMS keeps giving me the following message -
[2011-02-23 16:17:05 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
Here are the logs from just before adb restarts -
1291 locapi_rpc_glue V loc_ioctl
1291 RPC D written RPC packet size: [480]
1291 RPC D read RPC packet
1291 RPC D read RPC packet size: [28]
1291 lib_locapi V qct_loc_eng_inject_xtra_data, inject part = 100, len = 167, len = 167
1291 lib_locapi V qct_loc_eng_inject_xtra_data, total part = 100, len = 167
1291 locapi_rpc_glue V loc_ioctl
1291 RPC D written RPC packet size: [248]
1291 RPC D read RPC packet
1291 RPC D read RPC packet size: [28]
1291 lib_locapi D qct_loc_eng_inject_xtra_data: injected 39767, SUCCESS
1291 lib_locapi V inject_xtra_waiting = flase
1291 GpsLocationProvider D Releasing wakelock
1291 WifiService D releaseWifiLockLocked: WifiLock{NetworkLocationProvider type=2 binder=android.os.Binder@47aead50}
1291 WifiService D enable and start wifi due to updateWifiState
1218 rmt_storage I rmt_storage open event
1218 rmt_storage I rmt_storage client thread started
1218 rmt_storage I rmt_storage events processing done
1218 rmt_storage I rmt_storage register cb event
1218 rmt_storage I rmt_storage status id = 2
1218 rmt_storage I rmt_storage events processing done
1218 rmt_storage I rmt_storage open event
1218 rmt_storage I rmt_storage client thread started
1218 rmt_storage I rmt_storage events processing done
1218 rmt_storage I rmt_storage register cb event
1218 rmt_storage I rmt_storage status id = 2
1218 rmt_storage I rmt_storage events processing done
1218 rmt_storage I rmt_storage write event
1218 rmt_storage I unblock rmt_storage client thread
1218 rmt_storage I rmt_storage events processing done
1218 rmt_storage I rmt_storage write: bytes written = 3145216
1218 rmt_storage I rmt_storage write: bytes written = 512
1218 rmt_storage I rmt_storage status handle = 1
1291 BatteryStatsImpl I notePhoneSignalStrengthLocked: 4->3
1218 rmt_storage I rmt_storage write event
1218 rmt_storage I rmt_storage events processing done
1218 rmt_storage I unblock rmt_storage client thread
1291 PowerManagerService D New lightsensor value:40, lcdValue:143
1291 PowerManagerService D lightSensorChangedLocked, buttonValue >= 0, mPowerState = 3
1218 rmt_storage I rmt_storage write: bytes written = 3145216
1218 rmt_storage I rmt_storage write: bytes written = 512
1218 rmt_storage I rmt_storage status handle = 2
1291 RPC D read RPC packet
1291 RPC D read RPC packet size: [80]
1291 locapi_rpc_glue V Callback received: 80 (cb_id=0x50B0000 handle=1)
1291 RPC D written RPC packet size: [28]
1470 usicWidgetController D unbindMusicPlaybackService()
1707 MediaPlaybackService E BadQueue mPlayListLen : 0 mAlbumListLen : 0 mShrinkAlbumListLen : 0
1291 NotificationService V Battery Full, Charging
1291 lights E write ok string=0,len=1
1291 lights E write ok string=0,len=1
1291 lights E write ok string=0 0,len=3
1291 lights E write ok string=1,len=1
1707 MediaPlayer.java D setOnCompletionListener being cleaned to null
1291 lights E write ok string=0,len=1
1291 lights E write ok string=0 0,len=3
1291 NotificationService V Turn off Jogball/OJ LED
1291 NotificationService D cancelNotification, ACTION_NOTIFICATION_REMOVE,pkg=com.htc.music,id=1
1291 AudioService I AudioFocus abandonAudioFocus() from android.media.AudioManager@476ddee0com.htc.music.MediaPlaybackService$5@476dd838
Upvotes: 167
Views: 206829
Reputation: 1630
Did you try using the SDK version 8. Since the device is in 2.2, and your SDK is at 10, there might be conflict.
Best of luck with your downgrading efforts!
Upvotes: 1
Reputation: 11219
Solved it very conveniently by overwriting the binary file located in /usr/bin/adb
with the one from Android directory (~/Android/Sdk/platform-tools/adb
):
sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb
You can check the exact repositories with:
whereis adb
Upvotes: 0
Reputation: 35
I did the following I had the same mis match error in mac OS, I was trying to install an apk.
mv /usr/local/bin/adb /usr/local/bin/old_adb
brew cask install android-platform-tools
or brew reinstall --cask android-platform-tools
adb kill-server
adb start-server
If you are trying to install apk, reinstall and check.
Upvotes: 1
Reputation: 11219
For people developing with Android studio:
if you install adb with the command line it will probably conflict with the adb version installed by Flutter.
You can check that you have this problem with 2 different versions easily:
find /home -iname "*adb"|grep -i android
And then compare the return value between adb version
(located at usr/bin/adb and most likely a symbolic link for /usr/lib/android-sdk/platform-tools/adb ) with ~/Android/Sdk/platform-tools/adb version
You will get this kind of output:
$ ~/Android/Sdk/platform-tools/adb version
Android Debug Bridge version 1.0.41
Version 30.0.5-6877874
Installed as /home/{{{user}}/Android/Sdk/platform-tools/adb
$ adb version
Android Debug Bridge version 1.0.39
Version 1:8.1.0+r23-5~18.04
Installed as /usr/lib/android-sdk/platform-tools/adb
My advice is hence the following: DO NOT RELY ON sudo apt-get install adb
1/ You first want to remove adb installed through the command line: (this is way cleaner than sudo rm usr/bin/adb
sudo apt-get remove adb
2/ Then create symbolic link from the sdk to usr/bin (top answer already provided):
sudo ln -s ~/Android/Sdk/platform-tools/adb /usr/bin/adb
Now you can use the different command lines adb devices
, adb start-server
, adb kill-server
Upvotes: 3
Reputation: 51
It helped me to
stop the HTC Sync (in system tray)
rename HTC's adb.exe
which I found at that path:
C:\Program Files (x86)\HTC\HTC Sync 3.0\adb.exe.
Upvotes: 5
Reputation: 954
Systems: Mac OS
In my case, I did not have two adb servers running so none of the solutions helped.
I have updated Android Studio to the latest, but I also had an old version of adb installed using brew cask. And while I updated my Android Studio to the latest, the adb was still pointing to the brew installed older version.
So after updating the brew cask version, using:
brew cask install android-platform-tools
And making sure that the adb itself was pointing to the new version, the errors went away.
Upvotes: 0
Reputation: 1558
If you have multiple adb's running stoping them will do like if you are using vs code for flutter development closing vs code will help.
Upvotes: 0
Reputation: 1699
Question Iam coming from was marked as [duplicate] to this question but I havent seen the answer i needed here.
adb server version (41) doesn't match this client (36); killing... ADB server didn't ACK.
Look at this: https://stackoverflow.com/a/47797366/8187578
Upvotes: 0
Reputation: 2109
Got a quick way to do it First
sudo rm /usr/bin/adb
Then
sudo ln -s /home/{{username}}/Android/Sdk/platform-tools/adb /usr/bin/adb
Fastest way to fix the issue
Upvotes: 26
Reputation: 2042
in my case I updated the SDK (on the settings in genymotion), or then the genymotion update
Upvotes: -1
Reputation: 18501
I have seen the following error twice in the past week or so:
adb server version (40) doesn't match this client (41)
I fixed it by rebooting my PC every time. I do not know how to explain it.
I tried killing and starting adb via command line multiple timea, restarting Android Studio multiple times to no avail. Task Manager does not show adb.exe.
I am running Android Studio 3.4 on Windows 10 (V1809, Build:17763.503)
Edit (2019-05-30): When this happened for the 3rd time, I closed all applications, then restarted Android Studio, and the problem was solved. It seems that another application causes this. I will report back once I find the culprit.
Edit (2019-05-30): I have finally found the culprit - Visual Studio paired with a Macbook Pro for building and debugging an iOS app. Once VS is closed or the pairding is disabled, adb becomes normal.
Upvotes: 1
Reputation: 13033
This was caused in my case by running Visual Studio with an Android Xamarin project on the same machine as Android Studio - each IDE had a different adb server version running. I closed Visual Studio and the error went away.
Upvotes: 1
Reputation: 303
I experienced a similar problem where my attempts to use adb
such as adb logcat
provided this error output:
adb server version (40) doesn't match this client (36); killing...
This solution worked for me in 2018 on Ubuntu 18.04 from Android Studio 3.2.1 using terminal.
The commands are as follows:
adb kill-server sudo cp ~/Android/Sdk/platform-tools/adb /usr/bin/adb sudo chmod +x /usr/bin/adb adb start-server
You may need to adjust the cp
command arguments based on the path to Android/
on your system.
2nd generation kudos to my source: https://stackoverflow.com/a/40991118/7015599
Upvotes: 7
Reputation: 38223
To actually explain what happens:
The ADB executable has two components
When you start ADB for the first time you may notice a message like "starting ADB server". If you updated ADB after that, the newer executable needs to kill the obsolete server and start a new one with matching version.
This can also happen when you have multiple versions of ADB present on your development machine (Genymotion, Android SDK, phone OEM companion apps, various standalone scripts).
This does not concern the ADB installed on your phone/emulator.
The obvious (not necessarily easy) solution is to make sure you use the same version of ADB everywhere.
Upvotes: 0
Reputation: 38147
Since adb server is out of date. killing is now a dupe of this, copy-paste of a solution for Debian-based systems:
It might be that you installed the
adb
package in addition to the SDK's. In that case, asudo apt purge adb
might solve the problem.
Upvotes: 0
Reputation: 59
OS: Ubuntu
There are more than 1 adb are running. Check the current adb:
which adb
Expected Output : ANDROID_SDK/platform-tools/adb
Normally the result will be:
/usr/bin/adb
Delete this older version by:
cd /urs/bin
sudo rm adb
Upvotes: 2
Reputation: 12099
Are you using Genymotion for a virtual device?
if yes this error probably came out because ADB from Genymotion conflicted with your ADB from Android SDK(using same port number), to fix this simply go to settings
=> choose ADB
tab => click on the option Use custom Android SDK Tools
and set your SDK folder
after you configure this, try to restart your adb by going into folder platform-tools
which adb
placed and do this command:
./adb kill-server
./adb start-server
*tips: You may close the process of Genymotion before running the command above
Hope this help.
Upvotes: 301
Reputation: 3479
System: Windows 7, Android Studio.
This error occurred when I ran adb devices
from Windows Commandline.
The root cause was that the adb I was running from commandline was not the same adb running from Android Studio.
Solution:
First kill all running adb processes on the machine.
taskkill /F /IM adb.exe
Run your app from Android Studio.
Locate the exact File Location of adb.exe either from Windows Task Manager, OR by running the command below
wmic process where "name='adb.exe'" get ProcessID, ExecutablePath
On Windows Command prompt, run where adb
to locate the adb that runs from command prompt. This path would be different from the one in Step 3 above.
Edit Windows system variable PATH. Delete the base path found in Step 4 from it.
After you have edited PATH, you can see the current contents of this variable by typing below command in a NEW command prompt (don't use old prompt.)
echo %PATH%
Now, run adb from command prompt. It should NOT show any "server out of date error"!
Upvotes: 5
Reputation: 482
System: Windows 10
My issue: Setting Genymotion to point to the custom SDK didn't have any affect. I still received the:
Couldn't start project on Android: could not install smartsocket listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048) could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon
What I discovered was there was a difference in ADB versions being used throughout the system. Here is the command I used to find them:
where /r C:\ adb.exe
This produced the results:
C:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
C:\Program Files\Genymobile\Genymotion\tools\adb.exe
C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
C:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb backup\adb.exe
Navigating to each directory and running:
adb.exe version
Allowed me to see that Expo was running ADB version:
Android Debug Bridge version 1.0.36
Revision fd9e4d07b0f5-android
While Genymotion using the custom SDK had version (c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe):
Android Debug Bridge version 1.0.39
Revision 3db08f2c6889-android
As a test I took the adb files (adb.exe, AdbWinApi.dll, AdbWinUsbApi.dll) from
c:\Users\kyle\AppData\Local\Android\Sdk\platform-tools\adb.exe
and placed them into a backup folder. I then moved the adb files located at
c:\Program Files\Expo XDE\resources\app\node_modules\xdl\binaries\windows\adb\adb.exe
into that same location. I killed adb with:
adb kill-server
which caused a restart of the adb server automatically due to having my Genymotion device already running. I hit the "Restart" button inside of the Expo XDE and it immediately began working. Here is the log where I hit the restart button at 1:13:04 AM:
12:45:53 AM
could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048)
could not read ok from ADB Server
* failed to start daemon *
error: cannot connect to daemon
1:13:04 AM
Restarting project and clearing packager cache (Hold shift while clicking restart to avoid clearing cache).
1:13:11 AM
Starting React Native packager...
1:13:17 AM
Scanning 543 folders for symlinks in C:\Users\kyle\git\betalog\node_modules (49ms)
1:13:17 AM
1:13:19 AM
Couldn't adb reverse: closed
1:13:20 AM
Project opened! You can now use the "Share" or "Device" buttons to view your project.
1:13:26 AM
Couldn't adb reverse: closed
1:13:26 AM
Downloading latest version of Expo
1:13:28 AM
Installing Expo on device
1:13:33 AM
Opening on Android device
1:13:56 AM
Building JavaScript bundle: finished in 59643ms.
1:14:01 AM
Dependency graph loaded.
1:14:03 AM
Your JavaScript transform cache is empty, rebuilding (this may take a minute).
Conclusion: Genymotion and Expo may need to use the same version of adb so that Expo can properly communicate with the simulated device. Pointing Genymotion to your android SDK location as well as ensuring Expo XDE has that same version will allow correct communication between devices. I moved the Expo XDE version to the SDK location, but you might be able to go the other way (take the sdk ADB files and place them in the Expo XDE resource location).
P.S. I've been all through the stackoverflow posts related to this issue. Just so you guys know my task manager shows three instances of adb.exe running. If you kill any of them they just come back.
Hope this helps /cheers
Upvotes: 14
Reputation: 53119
In my case, the problem was caused by Virtuous Ten Studio, which has the adb.exe in External/ADB
directory.
Go there and run .\adb.exe kill-server
and you'll be good.
Upvotes: 1
Reputation: 6043
This is caused because you are running a adb other than the one included in the SDK. If on linux check where is the adb binary located
which adb
Expected Output : ANDROID_SDK/platform-tools/adb
If not pointing to ANDROID_SDK/platform-tools/adb then you are running some old version of adb installed on a different location on the machine.
Nothing wrong running adb other than the one provided with SDK but the downside is it is not updated automatically when the android SDK is updated and that's why you running into this out-dated version issue.
The easier fix and to avoid this issue in future rename the older (misleading) adb binary file to something else.
Follow the steps to resolve this issue.
$ which adb
*o/p /usr/bin/adb - (output will depend on your machine)*
$ cd /usr/bin/
$ ls -lt | grep adb
*o/p -rwxr-xr-x 1 root root 160912 Mar 31 2016 adb*
$ sudo mv adb adb_bakup
$ ls -lt | grep adb
o/p -rwxr-xr-x 1 root root 160912 Mar 31 2016 adb_bakup
$ export PATH="/path/to/android_sdk/platform-tools:$PATH"
$ which adb
*o/p <your android sdk dir>/platform-tools/adb* ---> You are all good now
Upvotes: 22
Reputation: 2575
First close All the things which use ADB. (Android Studio, Eclipse, Emulator(Bluestack as well)) and then do
adb kill-server
adb start-server
In my case I just got update of Studio.
Upvotes: 4
Reputation: 5
I was getting this same error when I started Android Studio. Uninstall the mobogenie software. It worked. TRY THIS SOLUTION, IT HELPED ME. ADB ERROR
Upvotes: -9
Reputation: 1512
In my machine (Ubuntu 14.04 and Genymotion 2.5.2) the source of the problem was that, I had 2 adb files of different versions.
(Before, narrowing down this problem source, I already had Genymotion's Settings > "Use custom Android SDK tools" referring to my machine's installed Android SDK directory as advised by Aditya Kresna Permana. I also tried with killing and starting the adb server and few other solutions from around the web).
Then saw, that running adb version
from my Android SDK installation directory “~/Android/Sdk/platform-tools” produced - "Android Debug Bridge version 1.0.32"
But, adb version
command from “/usr/bin” directory produced- “Android Debug Bridge version 1.0.31"
So just followed - http://bernaerts.dyndns.org/linux/74-ubuntu/328-ubuntu-trusty-android-adb-fastboot-qtadb to update the adb in “/usr/bin”
# adb version
Android Debug Bridge version 1.0.31
# wget -O - https://skia.googlesource.com/skia/+archive/cd048d18e0b81338c1a04b9749a00444597df394/platform_tools/android/bin/linux.tar.gz | tar -zxvf - adb
# sudo mv adb /usr/bin/adb
# sudo chmod +x /usr/bin/adb
# adb version
Android Debug Bridge version 1.0.32
And now running adb devices
works perfectly as expected.
And it also solved the associated problem that, before my PhoneGap (Cordova) app was not getting integrated with the Genymotion's virtual device. Now obviously that problem solved as well.
Upvotes: 21
Reputation: 15685
There may be more than one adb process running on the system. Tools such as the Android Reverse Tether may use their own version of the adb tool, hence the version in memory may conflict with the version run from the command line (via the path variable).
In Windows, press CTL+Shift+ESC to access Task Manager, sort in the Image Name column, then kill all instances of adb.exe
by right-clicking, and choosing End Process. Note that there are multiple instances of adb.exe
below:
In a Linux environment, just use the kill -9
command. Something like this worked on an Android device running adb
(use ps
output, search using grep
for a process starting with adb
, get the Process ID from the adb
process(es), and send that ID to the kill -9
command):
kill -9 $(ps | grep "S adb" | busybox awk '{print $2}')
Once the adb
processes - and thus conflicts - are resolved, then retry running adb
from the command-line again:
adb start-server
Upvotes: 26
Reputation: 21
Unfortunately I do not have enough reputation to comment yet. But the response marked as an answer sent me in the right direction.
I did not see anything in my path related to HTC Sync Manager, though I had it installed. I'm not working with my HTC device at the moment, and only had the sync manager installed to help with driver issues. Once uninstalling the HTC sync manager this issue went away for me.
Hope this helps someone else.
Upvotes: 2
Reputation: 1751
I also had this problem today, turns out I disabled my network drivers because I had WIFI/LAN issues. re-enabling fixed the issue
Upvotes: 0
Reputation: 908
Okay, there is another instance of adb.exe distributed with "Lenovo Photo Companion". A friend of mine has a Lenovo Yoga notebook and had this software installed which includeded another adb.exe
Deinstalling it solved the problem.
Upvotes: 2
Reputation: 2113
As mentioned above, the problem comes due to a conflicting version of adb.exe shipped with HTC Sync. Removing it from PATH won't help, as htcUPCTLoader.exe that constantly runs in the background will still re-launch the wrong ADB version.
One solution would be to completely remove adb.exe from the HTC Sync folder, however this would break HTC Sync.
I've just coded a simple tool that replaces the old adb.exe with a stub that invokes the latest adb.exe from the SDK directory eliminating the conflicts (e.g. version 1.0.25 coming with HTC Sync and 1.0.29 with Android SDK).
The tool can be downloaded from http://visualgdb.com/adbfix
Upvotes: 0