I'm trying to learn Xamarin, but something happened to my setup and I can no longer open my app inside the emulator by clicking the Debug/Run button. All it does is open or activate (if it's already open) the Android Device Manager.
The Visual Studio output window (Build) states:
The debug was canceled. Please create an android emulator to debug the application.
I've created an emulator and it works. The emulator is running when I try to run my app.
Also, a message box pops up in the Android Device Manager that says:
Device Manager
Device 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.
I don't know what any of this means and I can't find the documentation that covers this.
'adb kill-server' doesn't have any effect. I've tried that command in the adb command prompt, and I've manually started up an admin command prompt and tried killing and restarting adbd. I've tried regenerating keys with 'adb keygen', but I can't anything to have any effect.
I'm on Windows 10.
The Xamarin Diagnostics window looks like this after I start VS, click Run, the Android Device Manager opens with the create new emulator dialog, I cancel out of that and run the emulator I already created, I wait for it to boot and then I click Run again, which just brings the ADM window forward.
[D:]: FindVersionFile: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Version, result=False
[D:]: FindVersionFile: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android\Version.txt, result=True
[I:]: Found Xamarin.Android 9.3.0.23
[I:sdk]: Runtime path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Xamarin\Android
[I:sdk]: Framework path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0
[D:]: ValidateAndroidSdkLocation: `C:\Program Files (x86)\Android\android-sdk`, result=True
[D:]: ValidateAndroidNdkLocation: ``, result=False
[I:]: Looking for Android NDK...
[I:]: Looking for Android SDK...
[D:]: ValidateAndroidSdkLocation: `C:\Program Files (x86)\Android\android-sdk`, result=True
[D:]: ValidateAndroidSdkLocation: `C:\Program Files (x86)\Android\android-sdk`, result=True
[D:]: ValidateJavaSdkLocation: `C:\Program Files\Android\Jdk\microsoft_dist_openjdk_1.8.0.25`, result=True
[I:]: Tracking android devices started
[D:]: Tracking avd started
[D:]: avd watcher *.ini path: 'C:\Users\Matt\.android\avd'
[D:]: avd watcher: got device list from avd with 0 devices
[D:]: TrackDeviceTask got:
[I:]: Got new device list from adb with 0 devices
[I:]: Looking for Android SDK...
[D:]: ValidateAndroidSdkLocation: `C:\Program Files (x86)\Android\android-sdk`, result=True
[D:]: ValidateAndroidSdkLocation: `C:\Program Files (x86)\Android\android-sdk`, result=True
[D:]: TrackDeviceTask got: emulator-5554 offline
[I:]: Got new device list from adb with 1 devices
Edit: I've found the device log, courtesy of the User Account Control window that pops up when I click the Run button without the Android Device Manager window open and it opens the ADM. The origin of the error is shown in the relevant part of the log:
[19-08-10 23:56:44.17] Executing command: "C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe" "-s" "emulator-5554" "shell" "getprop" "emu.uuid"
[19-08-10 23:56:44.21] C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe result:
StandardError: 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.
ExitCode: 1