Reputation: 8295
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
Upvotes: 18
Views: 10271
Reputation: 121
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.
Upvotes: 0
Reputation: 11105
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 :(
Upvotes: 1
Reputation: 65
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.
Upvotes: 0
Reputation: 1917
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.
Upvotes: 3
Reputation: 372
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.
Upvotes: 5