Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio emulator for Android stuck at "OS is starting...", only on API Level 23 / Android 6

Since I read the news about Xamarin now being "free", I immediately installed Visual Studio 2015 Update 2 and the Android tooling (NDKs, SDKs for 19-23, Visual Studio Emulator for Android dated January 2016) to start working on an Android application.

Excited I launched the emulator from Tools -> Visual Studio Emulator for Android and installed the profile that is the best match for my own phone. Since my phone is on Android 6, I decided to get a profile for API Level 23 / Android 6.

Since I had already enabled Hyper-V a few months ago, the installation for the profile only had to add me to the Administrators group and create 2 network adapters.

So far, so good.

Upon starting the emulator, it would stay at "OS is starting...". I figured I'd wait a while. I figured I'd wait a while longer too. After that, I gave up the possibility of it going to work and started investigating.

I also tried other profiles, a few others from API Level 23, one from 22 and one from 19. Only the ones from API Level 23 did not work.

The following steps are what I came up with so far by Googling etc. I tried them in all sorts of combinations:

  • Rebooting
  • Disabling / enabling Hyper-V
  • Removing vEthernet adapters (through the Hyper-V Manager).
  • Running XDECleanup
  • Allowing XDE through my Windows Firewall as application (incoming)
  • Restoring the emulator software in Programs and Features
  • Enabling / disabling "Processor Compatibility" in Hyper-V Manager.

This is the data I've gathered so far:

  • A screenshot of the error message that the emulator gives after waiting a long time (10 - 15 minutes, maybe a little longer)

1

  • A screenshot of the last part of the log when being connected to the Android 6 VM:

1

  • A screenshot of the last part of the log of a working VM (this one's from an Android 4.4 VM):

2

like image 545
Thijs Tijsma Avatar asked Apr 02 '16 12:04

Thijs Tijsma


People also ask

Why is my android studio emulator not working?

If the Android Emulator does not start properly, this problem is often caused by problems with HAXM. HAXM issues are often the result of conflicts with other virtualization technologies, incorrect settings, or an out-of-date HAXM driver. Try reinstalling the HAXM driver, using the steps detailed in Installing HAXM.

How do I enable Android emulator in Visual Studio?

Just open up the Visual Studio Emulator for Android entry in your Start Menu, hit play, and the emulator is ready to debug from any IDE. Download the standalone emulator today!

Why is my emulator stuck?

Fix 4 – Uninstall and Reinstall AVD From Android Studio, select “Tools” > “SDK Manager” > “SDK Tools“. Uncheck “Android Emulator“. Select “Apply” to have the emulator uninstalled. Once the emulator has been removed, check the “Android Emulator” box again, then select “Apply” to reinstall it.


2 Answers

Responses I've got so far from Microsoft:

-Those errors are normal -And the only step I've tryed which they told me to, and I don't see here, it's this one:

On Hyper-V Manager, check the option for compatibility under CPU section

Besides from this, just make sure that on Hyper-V you get only 2 switches, the one you use to connect to the internet and the one that the VS Emulator for Android creates, I haven't got any results, but if you try, maybe you will.

like image 100
Jesú Castillo Avatar answered Sep 29 '22 06:09

Jesú Castillo


In my case, I was mucking around with the VS emulator's virtual switches and had the network adapters in the wrong order.

After I moved the Windows Phone Emulator Internal Switch (Created when first running the VS Emulator) to the first Network Adapter slot in my settings, the emulator started up just fine. Apparently, order matters.

enter image description here

like image 36
Levi Fuller Avatar answered Sep 29 '22 07:09

Levi Fuller