Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

emulator broken: This adb server's $ADB_VENDOR_KEYS is not set

Well a windows 10 update broke sleep, the computer went to sleep with the emulator open and now that's broken. When I run an app to launch in the emulator it will boot the emulator but won't install just time out. When I try and run an app into a running emulator instance Studio says:

com.android.ddmlib.AdbCommandRejectedException: 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.
Error while Installing APK
  1. I've followed some of the other threads here. I've tried changing the environmental variable in control panel, but in fact I think it pointed to the right place originally, where the sdks are these days.
  2. I've tried restarting the PC. I did try deleting a couple of adb files, that didn't work.
  3. I've tried deleting all the sdks and downloading them again.
  4. I've tried uninstalling and updating Android Studio, several times. Now on AS 3.1, still not working.

Bit of a nightmare really.

How do I set the vendor keys? Using AS console commands? Can anyone point me to a dummies guide, this is a bit of a tangent for me, wish I could fix it from the GUI.

like image 498
Sam Avatar asked Oct 26 '17 22:10

Sam


People also ask

Where are ADB keys stored?

User-installed keys are stored in /data/misc/adb/adb_keys .


2 Answers

For anyone who might encounter this in the future -- I mean the ultimate issue of receiving the error, "This adb server's $ADB_VENDOR_KEYS is not set" despite not having any (or any sufficient) opportunity to click OK...

Resolution: In the Developer Settings, select the option to, "Remove existing authorized adb keys on device." Repeat the previous action -- the prompt will once again appear, as if the very first time. -Mike

like image 138
DiggerW Avatar answered Sep 22 '22 06:09

DiggerW


Combining answers from here and there gives an answer that also worked for me in IntelliJ IDEA. I assume the issue is the same, since the emulator and AVD is the same.

Option 1: Restart the emulator from AVD

Option 2: Wipe the emulator data

Option 3: Stop the emulator. Then make sure it is up to date and try again.

If it still does not work, restart the adb server and retry.

 adb kill-server && adb start-server

If it still does not work, perhaps your adb is out of date... somehow. This was the case for me. Running the following fixed that for me.

adb devices

adb server is out of date.  killing...
* daemon started successfully *
List of devices attached
emulator-5554   device

If it is now working for some emulators but not newly created ones, take note of the message in the emulator selection box: "Press Ok in the Allow USB Debugging Dialog"

Press Ok in the Allow USB Debugging Dialog

Sadly, there is no such dialog. So go and enable Developer Mode in the settings of your emulated OS by tapping the Build Number several times. Then go to the Developer Settings and enable USB debugging.

like image 41
lucidbrot Avatar answered Sep 22 '22 06:09

lucidbrot