18

I have created a new App (Xamarin.Forms Portable) project in Visual Studio 2015.

When I try to run Droid project in Visual Studio Emulator for Android, I just get a generic error message:

Could not launch 'VS Emulator 5" KitKat (4.4) XXHDPI Phone' device. Exit code 10

The Logs message is

06-Aug-15 1:42:39 PM: [Informational] Reinitializing installed profiles.
06-Aug-15 1:42:39 PM: [Informational] Installed profiles initialized. Devices: 2 Platforms: 1
06-Aug-15 1:42:42 PM: [Informational] Reinitializing installable profiles.
06-Aug-15 1:42:42 PM: [Informational] Installable profiles initialized. Devices: 30 Platforms: 4
06-Aug-15 1:42:46 PM: [Informational] Waiting to launch device...
06-Aug-15 1:42:46 PM: [Informational] Launching Device: 5" KitKat (4.4) XXHDPI Phone
06-Aug-15 1:42:46 PM: [Informational] Validating emulator arguments...
06-Aug-15 1:42:46 PM: [Informational] Determining if emulator is already running...
06-Aug-15 1:42:46 PM: [Informational] Preparing virtual machine...
06-Aug-15 1:43:46 PM: [Informational] Launching emulator...
06-Aug-15 1:44:40 PM: [Critical] Could not launch 'VS Emulator 5" KitKat (4.4) XXHDPI Phone' device. Exit code 10.
06-Aug-15 1:44:40 PM: [Critical] XDE Path: C:\Program Files (x86)\Microsoft XDE\10.0.10240.0\xde.exe
06-Aug-15 1:44:40 PM: [Critical] XDE Arguments: /sku Android /displayName "VS Emulator 5\" KitKat (4.4) XXHDPI Phone" /memSize 2048 /diagonalSize 5 /video "1080x1920" /vhd "C:\Users\jagan\AppData\Local\Microsoft\VisualStudioEmulator\Android\Containers\Local\Devices\vhd\5_KitKat_(4.4)_XXHDPI_Phone\image.vhd" /name "VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.jagan"
06-Aug-15 1:44:40 PM: [Critical] XDE Exit Code: 10
Jagadeesh Govindaraj
  • 6,977
  • 6
  • 32
  • 52

5 Answers5

5

Are you running the emulator in a physical machines? I have similar issues but in nested vms.

Did you check if the hyper-v manager is running properly? Try to open it and start the vms manually and check what is the outcome.

Also, it is really important that you can see the properties in the virtual switch. Most of the problems with hyper-v are due to bad configuration in the virtual switch.

Did you check this answer?

Visual studio (2015) emulator for android not working - XDE.exe - Exit Code 3

Try to do this

1) Repair Android SDK - go to Programs and Features > Microsoft Visual Studio Emulator for Android > Change and hit "Repair"

2) Remove All Hyper-V virtual switches - go to Hyper-V > Virtual switch manager > Remove all virtual switches

3) Run XdeCleanup.exe - In my case: "C:\Program Files (x86)\Microsoft XDE\10.0.10240.0"

4) In my case I had configured Internet connection sharing on Ethernet adapter before so I had to disable it

Check all those things and post more information, I need more details to give you a more complete answer.

Community
  • 1
  • 1
Juan Acosta
  • 371
  • 3
  • 10
  • I make it work using a nested hosting that means using vm on my host machine and the nested vm use the hyper v for the emulator. Can you expand how are you running the machines? Are you running in a physical machine? – Juan Acosta Sep 04 '15 at 09:03
  • Try to disable opengl in the emulator. Check this [link](http://stackoverflow.com/questions/29547546/visual-studio-android-emulator-will-not-start-fully) and let me know what happen. – Juan Acosta Sep 07 '15 at 00:13
  • It didn't work in the first go, had to run VS and emulator twice to work – RelativeGames Nov 09 '15 at 09:17
3

I didn't know Android Emulator for Visual Studio worked with Hyper-V. Thanks to @Juan pointing out, I remembered I had switched off Hyper-V some months ago when I installed VMWare. Back in those days I followed this guide and I did run the command:

bcdedit /set hypervisorlaunchtype off

Simply re-enabling it with

bcdedit /set hypervisorlaunchtype auto

and rebooting fixed my problem. I don't know if it's your problem, but that fixed mine that was presenting the same warnings.

Jamby
  • 1,886
  • 2
  • 20
  • 30
1

I am running Visual Studio within a Parallels virtual machine and got it to work after lowering the amount of RAM that the emulator initially was setup for.

First I made sure Nested virtualization and PMU virtualization was enabled in the Parallels VM settings (click your VM window on your Mac then at the top Mac settings bar go to Actions -> Configure -> Hardware -> CPU & Memory -> Advanced Settings)

Then start up your VM (I am using Windows 8.1) and head to Hyper-V Manager.

Select the Android Emulator you are trying to start (I was trying to start the 7" KitKat (4.4)) then right-click -> Settings -> Memory and I changed the Startup RAM from 1024 to 512 and started it from within the Hyper-V Manager.

Once it starts up fine from within Hyper-V Manger, shut it down and then go back to Visual Studio and try to start the emulator again from there. It looks like the RAM gets reset back to 1024 after starting it the second time from Visual Studio but for some reason it started up fine after that. Maybe it was just a coincidence...

*Edit: ... it didn't work again after that last time so maybe it was a coincidence :(

hvaughan3
  • 10,955
  • 5
  • 56
  • 76
  • I too had the same issue with starting the emulator from within a Parallels Windows 8.1 VM. Enabling Nested virtualization and PMU virtualization worked for me. Thanks @hvaughan3 – Rusty Wizard Nov 21 '16 at 16:29
0

I had a similar issue with not enough disk space. Using the Hyper-V Manager I moved the Vitrual Machine and Disk to my secondary drive.

Ian Beeson
  • 65
  • 1
  • 5
0

Well, for me, the problem is caused by a silly mistake.

XDE Exit Code: Unknown (-1073741819)

XDE Exit Code: GenericError (1)

I've used to use secondary HDD in my CD drive and Hyper-V was bound to drive D. I've removed the HDD for reasons.

After a while, when I tried to create and only drive C is present, I got error.

Community
  • 1
  • 1
Efe Erdoğru
  • 121
  • 2
  • 10