Reputation: 293
I have created a new, bare bones, Xamarin Cross Platform application and I get the following error when running the Android project in a VS emulator using Marshmallow (6.0 API 23):
Waiting for runtime checks to complete
The emulator boots up successfully and the project builds without warnings or errors. I've left it in this state overnight, but it fails to get past this point.
Any direction/suggestions would be appreciated.
EDIT 1: Using the Android SDK image works, so the issue seems to be with the Hyper-V VM.
Upvotes: 26
Views: 11980
Reputation: 11
I had the same issue with Pixel 2 Pie 8.1(API 27), and I downloaded an upper version of it, Pixel 2 Pie 9.0(API 28), so it has solved the issue.
Upvotes: 0
Reputation: 5254
So in my case, I had another Android SDK installation used, before Visual Studio installed its own. I also had the ANDROID_SDK_ROOT
and ANDROID_SDK_HOME
environment variables setup to different folders.
To solve the issue, I first changed the ANDROID_SDK_ROOT
environment variable to the path that was configured with VS (where the VS installed Android SDK is, see Tools -> Options -> Xamarin -> Android Settings -> Android SDK Location
), which was C:\Program Files (x86)\Android\android-sdk
in my case. VS needs to be restarted after that, so it loads the new environment variable values.
That alone was not enough to let VS successfully connect to the AVD via ADB. The reason was, that the .android
directory under my ANDROID_SDK_HOME
path still contained the old adbkey
and adbkey.pub
files from my previous installation.
I therefore replaced them with the ones from the VS installed SDK (in my case located in C:\Users\<UserName>\.android
).
(Just deleting the old files is probably good enough too, but I haven't tested it.)
After that, VS was able to connect to the AVD again.
Upvotes: 0
Reputation: 2368
I managed to fix this error by doing following the below steps:
>>
arrows in the tool-bar to the right.adb connect [IP_FROM_STEP_#4]
.You should only need to do this each time the emulator is started. It didn't solve the issue of VS not connecting automatically, but I find it easy enough to do in order to carry on.
As a side note, if the applications runs and immediately quits, then do the following:
After looking at the link provided by @masound I found that the registry key was missing. So, I did the following:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node
.Path
and value C:\Program Files (x86)\Android\android-sdk
.Upvotes: 16
Reputation: 101
I was having the same issue. Spent hours trying to fix it. Tried all the answers above to no avail. Opened Android Device Manager and did a Factory Reset on all of my emulators. It fixed the problem.
Upvotes: 10
Reputation: 5944
You need restart ADB service. Visual Studio-Service-Android-restart adb service. It helped for me.
In Visual Studio from the Menu Bar: Tools -> Android -> Restart Adb Server
Upvotes: 27
Reputation: 1065
I ran into this. Rebooted the machine and the device. All good now.
Upvotes: 3
Reputation: 2517
Uninstall the app on the emulator and restart the emulator.
That seemed to be the thing that did it for me. I was on a Android 6 emulator, with HAXM. I also tried disabling Use Shared Runtime
and Use Fast Deployment (debug mode only)
in xamarin.android > properties > android options
which may have helped in the past but I don't think helped this time. ...it could have also been rebooting my computer seven times and turning hyper-v on and then off through windows features
but who knows.
Upvotes: 0
Reputation: 116
In this link there are some issue fixings for VS android emulator. One of them is about this problem that adb cannot connect to the emulator. This is caused by the difference between the path of adb that emulator points, and the real path of adb that visual studio works with. This conflicts might be caused by updating visual studio or its components. The simple and permanent solution is to change the path that emulator points to. Just do the followings:
Upvotes: 4