Xamarin "Waiting for runtime checks to complete" and VS Emulator
Asked Answered
C

8

26

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.

  • VS: 15.7.1
  • Xamarin Forms: 3.0.0.482510

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.

Curdle answered 15/5, 2018 at 8:51 Comment(0)
O
16

I managed to fix this error by doing following the below steps:

  1. Build and Run the application .
  2. The build will stall with at "Waiting for Runtime Checks".
  3. In the emulator click the >> arrows in the tool-bar to the right.
  4. Make a note of the IP address for the Windows Phone Emulator Internal Switch.
  5. Back in VS. From the menu select Tools → Android → Android ADB Command Prompt
  6. Type adb connect [IP_FROM_STEP_#4].
  7. The build should continue.

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:

  1. Stop the emulator.
  2. Open the Hyper-V Manager application.
  3. Right-click the emulator and select "Settings".
  4. Expand the "Processor" node and select "Compatibility".
  5. Tick "Migrate to physical computer with different processor version".

After looking at the link provided by @masound I found that the registry key was missing. So, I did the following:

  • Added the "Android SDK Tools" key to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node.
  • Added a string value with the name Path and value C:\Program Files (x86)\Android\android-sdk.
Outcome answered 17/5, 2018 at 11:13 Comment(2)
for most of us, the emulator screen is black - so no ">>" to click onRattle
yeah, whats the ">>" we're supposed to click on? restarting the adb server worked for meLaundrywoman
N
27

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

Nickelodeon answered 14/8, 2018 at 12:3 Comment(1)
This is the solution. Thanks.Carmelinacarmelita
O
16

I managed to fix this error by doing following the below steps:

  1. Build and Run the application .
  2. The build will stall with at "Waiting for Runtime Checks".
  3. In the emulator click the >> arrows in the tool-bar to the right.
  4. Make a note of the IP address for the Windows Phone Emulator Internal Switch.
  5. Back in VS. From the menu select Tools → Android → Android ADB Command Prompt
  6. Type adb connect [IP_FROM_STEP_#4].
  7. The build should continue.

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:

  1. Stop the emulator.
  2. Open the Hyper-V Manager application.
  3. Right-click the emulator and select "Settings".
  4. Expand the "Processor" node and select "Compatibility".
  5. Tick "Migrate to physical computer with different processor version".

After looking at the link provided by @masound I found that the registry key was missing. So, I did the following:

  • Added the "Android SDK Tools" key to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node.
  • Added a string value with the name Path and value C:\Program Files (x86)\Android\android-sdk.
Outcome answered 17/5, 2018 at 11:13 Comment(2)
for most of us, the emulator screen is black - so no ">>" to click onRattle
yeah, whats the ">>" we're supposed to click on? restarting the adb server worked for meLaundrywoman
M
10

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.

Mecke answered 19/9, 2019 at 20:56 Comment(1)
Same issue. So far 2 solid days of this nightmare. Not one solution here works. All this on a newly built machine.Rattle
T
4

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:

  1. Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools in the folder tree on the left.
  3. Modify the Path registry variable to match the path to your Android SDK.
  4. Restart the emulator and you should now be able to see the emulator connected to ADB and associated Android tools.
Thinkable answered 25/5, 2018 at 2:18 Comment(1)
Tried this too. No joy.Rattle
S
3

I ran into this. Rebooted the machine and the device. All good now.

Samiel answered 26/6, 2018 at 14:39 Comment(2)
No working solutions. It's 2020 and, as per Google, there are still about 20,000 devs querying this problem as of December. Is this a Microsoft bug or an Android SDK bug?Rattle
I just started having this issue to with physical devices, github.com/xamarin/xamarin-android/issues/5532Heavyarmed
A
0

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.

Aretta answered 5/6, 2018 at 13:14 Comment(0)
Q
0

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.

Quetzal answered 12/12, 2020 at 4:1 Comment(0)
L
0

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.

Lothar answered 5/2, 2021 at 17:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.