0

I am trying to follow the instructions on this webpage: https://devblogs.microsoft.com/visualstudio/hyper-v-android-emulator-support/

I have reached step 2 and downloaded the zip file. However, there is no executable. How do I install this preview? Is the preview the same as this: https://visualstudio.microsoft.com/xamarin/ ?

Update

Following Rajesh Sonars answer, here is the error I get running inside Visual Studio 2019:

1>------ Build started: Project: App1, Configuration: Debug Any CPU ------
1>App1 -> C:\Users\bert\Desktop\Xamarin2019\App1\App1\App1\bin\Debug\netstandard2.0\App1.dll
2>------ Build started: Project: App1.Android, Configuration: Debug Any CPU ------
2>  App1.Android -> C:\Users\bert\Desktop\Xamarin2019\App1\App1\App1.Android\bin\Debug\App1.Android.dll
2>  No way to resolve conflict between "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" and "mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e". Choosing "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" arbitrarily.
3>Starting deployment to my_device ...
3>Starting emulator my_device ...
3>C:\Program Files (x86)\Android\android-sdk\emulator\emulator.EXE -no-boot-anim -avd my_device -prop monodroid.avdname=my_device
3>Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.emulator: ERROR: x86 emulation currently requires hardware acceleration!
3>
3>Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable.
3>CPU acceleration status: HAXM is not installed on this machine
3>Emulator my_device cannot be started.
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

Update 2

My processor is: Intel (R) Core i7 950 @ 3.07 GHz. I have the following BIOS: P6X58D-E version 0502

I initially enabled the two settings in the BIOS:

advanced/cpu configuration/Intel(R) Virtualisation Tesc
advanced/chipset/intel vt-d configuration/intel vt-d

Is there anything else I need to enable. I accessed my BIOS this morning to retrieve these settings (so I could update my question) and it appears the second one is disabled. I definitely enabled it (I even took a photo at the time and checked the photo today). I am going to try and enable it later. I want to research what it is first though because I tend to experience BSOD when I change BIOS settings.

w0051977
  • 15,099
  • 32
  • 152
  • 329
  • You can read this document about [Hyper-V & HAXM](https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?pivots=windows). – nevermore Aug 20 '19 at 02:31

1 Answers1

0

On Windows:

To try out Xamarin Preview features, you need to install Visual Studio Preview version which can be install side by side of your stable/release Visual Studio.

On Mac: You can select preview update channel

Observation : If I try to launch emulator by running the app, I get following error and deployment get cancelled.

enter image description here

But, If I launch emulator explicitly from Tools > Android > Android Device Manager > Start, then it launches and I can deploy and test on it.

Rajesh Sonar
  • 279
  • 3
  • 11
  • Thanks. Does that mean if I want to use Hyper-V with Xamarin Forms then I have to install this? – w0051977 Aug 19 '19 at 18:33
  • Are you running VS2017 or 2019? If 2019, then probably you don't need to install preview. You just need to follow [3rd step](https://devblogs.microsoft.com/visualstudio/hyper-v-android-emulator-support/) from this guide. – Rajesh Sonar Aug 19 '19 at 18:52
  • It looks like hyper-v is not enabled on your system. Here is guide to [enable Hyper-v on Windows 10](https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v). – Rajesh Sonar Aug 19 '19 at 19:35
  • Docker runs perfectly. Does that not mean hyperv is working properly? Thanks. – w0051977 Aug 19 '19 at 19:36
  • OK...that means Hyper-V is good. Have you followed this Note from this [guide](https://devblogs.microsoft.com/visualstudio/hyper-v-android-emulator-support/) `More recent versions of the emulator (27.2.8, 27.3.0, or later), require an emulator flag while the feature is in the preview. To do this, create or edit the file C:Users.androidadvancedFeatures.ini and add the line “WindowsHypervisorPlatform = on”, or start the emulator from the command line with “-feature WindowsHypervisorPlatform”` – Rajesh Sonar Aug 19 '19 at 19:42
  • I tried creating a file called androidadvancedFeatures.ini and adding the line you suggested. It made no difference. This seems to suggest it is not necessary: https://curia.me/hyper-v-support-for-google-android-emulators/ – w0051977 Aug 19 '19 at 19:56
  • I get the error contained in my OP update when I try to run the emulator from the command prompt. Do you have any other suggestions? Thanks. – w0051977 Aug 19 '19 at 20:02
  • Before I accept; I have come across this: https://stackoverflow.com/questions/48759022/warning-quick-boot-snapshots-not-supported-on-this-machine. Could this be the reason? API levels 21 or less seem to work ok. – w0051977 Aug 19 '19 at 20:50
  • I have an intel core i7 (2010). – w0051977 Aug 19 '19 at 21:02
  • I tried it...and got Docker and Android emulator running side by side on Windows 10. Used `Android 9.0 Intel x86 Atom System Image`. Which image are you using? But one thing is for sure, that Visual Studio version has nothing to do with it. BTW, that processor is little aged ;) – Rajesh Sonar Aug 20 '19 at 05:21
  • Try to launch emulator separately Tools -> Android -> Android Device Manager -> (Select emulator to launch) Start – Rajesh Sonar Aug 20 '19 at 07:55
  • I am using the same image as you. Could you have a look at my second update? – w0051977 Aug 20 '19 at 08:16