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

6

16

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.

Norris answered 26/10, 2017 at 22:16 Comment(1)
Other StackOveflow answers were suggesting to use Settings > Doveloper options > Revoke USB debugging authorizations to solve it, but Settigns app is crashing when using that. Reported a but to Google as per developer.android.com/studio/report-bugs.html#emulator-bugsPresumptive
N
7

OK so eventually downloading a nexus 4 x86 image android 27, with no play store worked. Sorry if this is repetition. Long live working emulators

Norris answered 1/11, 2017 at 19:15 Comment(2)
Sadly, the one that I work needs Google Play Services :(Windlass
This is a solution (no play services) but I'm wondering why the emulators with google play services do not work. Anyone?Cupellation
C
9

The working fix for this particular issue is to enable Developer options on your emulator and enable "USB Debugging".

Castra answered 1/12, 2018 at 9:59 Comment(1)
Enabling Developer Option and USB Debugging worked for meFurnary
N
7

OK so eventually downloading a nexus 4 x86 image android 27, with no play store worked. Sorry if this is repetition. Long live working emulators

Norris answered 1/11, 2017 at 19:15 Comment(2)
Sadly, the one that I work needs Google Play Services :(Windlass
This is a solution (no play services) but I'm wondering why the emulators with google play services do not work. Anyone?Cupellation
P
7

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.

Pawl answered 2/1, 2019 at 22:13 Comment(1)
option 2 worked for me, thanks.Gio
L
4

After recent upgrades of emulator, the virtual device*) stays unauthorized. When I cold boot the emulator, sometimes I see the expected confirmation dialog, but this dialog goes away immediately, leaving no chance to click 'OK'.

We're aware of this problem and plan to fix it soon.


* Here, I was running x86 with API 28 and Google Play on Windows 10. I don't know which other scenarios are effected.

Laparotomy answered 7/2, 2019 at 15:11 Comment(0)
N
1

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

Nowell answered 23/11, 2021 at 16:57 Comment(0)
B
1

Go to developer options in your device and click on 'Revoke USB debugging authorizations'. Disconnect and reconnect your device. You'll get a prompt on your device to authorize your computer to connect to your device. click on 'OK' and your set.

Basically, the authorization key has gone out of date or it's no longer present. So, we just have to set a new autorization key and revoke the old ones.

Ballonet answered 31/10, 2022 at 3:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.