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
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!
What we did was to go first to Android Studio and open a virtual Device with AVD Manager. After that, you'll see other devices in your Visual Studio Code. Also, your visual studio code settings are found here: File -> Preferences -> Setting -> User Setting -> Extensions -> Emulator Configuration.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With