$ADB_VENDOR_KEYS is not set. Alternate fix in 2022.
I needed to back up my phone. I’ve got issues with SMS and MMS just not working after a couple of days at a time and something like 12 gigabytes of stored messages at this point that I will never read most likely. I went to this handy dandy website called Pocketables and tried the old back up an Android device to the PC and was met with the following error:
error: device unauthorized.
This adb server’s $ADB_VENDOR_KEYS is not set
Try ‘adb kill-server’ if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Googling that after kill-server didn’t work, I found multiple pages that indicated that removing the directory .android from %userprofile%, then stopping and starting ADB via “adb kill-server” should fix it.
I deleted %userprofile%\.android and stopped and started the server and .android was recreated but what I was attempting to do still resulted in the same error. This step here might have you taken care of (c:\users\yourname\.android is about where that folder is.) If this worked for you, great. It didn’t for me.
$ADB_VENDOR_KEYS just hates you
I watched a six minute video with a guy slowly talking his way to a solution… I wanted to shake him by the end… it was not a solution that worked. No matter what I did including unplugging the phone, plugging it back in, revoking authorization, etc… never would the phone ask for authorization again. Rebooted PC, cast a hex, cried to the gods.
On my phone under developer options I finally turned off USB debugging, and turned it back on.
Suddenly I was once again in normal ADB land. I was asked on my phone if I wanted to grant ADB access, and things worked again.
So yes, the solution here evidently is turn it off and back on again, although in my particular case the turning off and back on was done on the phone side and probably the destruction of the .android folder on the PC was not something that was needed.
I’ve noticed on my S21 Ultra that this appears to be a recurring issue. As in I repaired it hours ago and had to do it again while writing this article. Only the turning USB debugging off and on again on the phone, none of the Windows folder deleting. I’m not sure if this is an issue with the current release or if I’m just lucky but the backup appeared to have disconnected when the screen turned off and adb failed again.