Android Studio - ADB start server fails, adbkey check fails

MacosAndroid StudioAdb

Macos Problem Overview


Problem: adb start-server fails.

--- adb starting (pid 1414) ---
adb I 12-05 17:28:30  1414 48453 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 12-05 17:28:30  1414 48453 main.cpp:57] Version 27.0.0-4455170
adb I 12-05 17:28:30  1414 48453 main.cpp:57] Installed as /Users/[username]/Library/Android/sdk/platform-tools/adb
adb I 12-05 17:28:30  1414 48453 main.cpp:57] 
adb I 12-05 17:28:30  1414 48453 adb_auth_host.cpp:416] 
adb_auth_init...
adb I 12-05 17:28:30  1414 48453 adb_auth_host.cpp:174] read_key_file '/Users/[username]/.android/adbkey'...
adb F 12-05 17:28:30  1414 48466 transport_usb.cpp:37] Check failed: usb_packet_size < 4096ULL (usb_packet_size=5120, 4096ULL=4096) 

Catalyst: Installing platform tools v27.0.0

Solutions Tried: Restarting Android Studio, Restarting computer, Manually starting ADB via terminal, deleting /Users/[username]/.android/adbkey and adbkey.pub, and reinstalling platform tools

Also I am not using genymotion, just the stock emulator.

Macos Solutions


Solution 1 - Macos

It is a bug with the latest version of the platform tools (27.0.0), the solution I found was to downgrade to the previous version.

Remove the current platform-tools directory located in the android-sdk directory, then download the older version from here:

[Update]: Some users (myself included) have noticed that the issue only happens when your phone is plugged in, so if you don't need to test on it, try to unplug it and use an emulator. Also worths noticing that all reported devices were from the Google Pixel line, so other devices might not cause the issue.

[Update 2]: This seems to be solved in the latest update of the platform-tools (27.0.1).

Solution 2 - Macos

To add to the answer, here are some commands to quickly rollback on Macs. This was borrowed and tweaked from a helpful post in the bug tracker

cd $ANDROID_HOME && rm -rf platform-tools/ && curl https://dl.google.com/android/repository/platform-tools_r26.0.2-darwin.zip -o platform-tools_r26.0.2-darwin.zip && unzip platform-tools_r26.0.2-darwin.zip

Solution 3 - Macos

I ran into the same issue.

I got 27.0.0 to work by "Revoke USB debugging authorizations" under Debug Settings on the phone and rebooting phone and rebooting Mac. And it worked.

However, I had switched to not using my dock and plugging a Pixel straight into the MacBook (USB-C) since I had earlier suspected that. But that is not my normal hook up.

When I switched back to the dock the whole problem started again.

So I guess I'll roll back to 26.0.2

Solution 4 - Macos

I got this issue when i got a new usb-c usb 3.0 cable. However when i use my other cable (which came with the phone - usb-c to usb 2.0) i did not get the issue. I hope this helps when you don't want to rollback your platform tools, and have a couple of spare cables lying around ;)

Solution 5 - Macos

I had the same issue after updating to API 27. I also have a Pixel, which was plugged in at the time. Unplugging the device and starting the adb server manually with adb start-server worked for me.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionRJ AylwardView Question on Stackoverflow
Solution 1 - MacosMokkunView Answer on Stackoverflow
Solution 2 - MacosHansReichView Answer on Stackoverflow
Solution 3 - MacosmswlogoView Answer on Stackoverflow
Solution 4 - MacosDario3dView Answer on Stackoverflow
Solution 5 - MacostylerView Answer on Stackoverflow