Unable to use x86 emulator with Xamarin - visual-studio

I'm trying to follow along with the Xamarin guide for Android. I'm getting an alert saying that x86 emulators are 10x faster. But when I try to use an X86, version whether I create it or using the default one it fails. This happens on windows as well as mac. It works just fine with an arm processor.

Unable to use x86 emulator with Xamarin
Have you disabled Hyper-V in your computer? If you didn't turn off this windows feature, you will get error message " it fails" when you use an X86 Android emulator.
You should turn off your Hyper-V :
Run Cmd as administrator
Execute the following commond :
bcdedit /set hypervisorlaunchtype off
Reboot your computer
And if you want a better performance, you should use Hardware Acceleration.

The problem was because I didn't have HAXM installed. I had to go into the BIOS and enable virtualization. Then install HAXM from Intel's site. For some reason I can do it view SDK manager.

Related

Visual Studio: Xamarin - Error starting Android Emulator

Problem encountered on https://dotnet.microsoft.com/learn/xamarin/hello-world-tutorial/devicesetup
Operating System: Windows 10 Pro
Using the Hello World xamarin example in Visual Studio - I'm unable to start the Android Emulator.
When I click on the Run button in the Android Device Manager - the error appears immediately (See attached)
Error-AndroidDeviceManager (Emulator including Google Play/Google API)
Emulator error
Device error: WARNING: unexpected '-prop' value ('monodroid.avdname=pixel_2_pie_9_0_-_api_28'), only 'qemu.' properties are supported
WARNING: unexpected '-prop' value ('emu.uuid=4b63b139-cc77-4b66-9200-0d25f8fc545e'), only 'qemu.' properties are supported
Same Error when Emulator is not using Google Play/Google API
Same Error when Emulator is not using Google Play/Google API
Windows Specifications
Edition: Windows 10 Pro
Version: 1909
Processor
AMD Ryzen 9
Task Manager:
Performance: Virtualization is Enabled
cmd - systeminfo:
Hyper-V Requirements: VM Monitor Mode Extensions: Yes
Virtualization Enabled In Firmware: Yes
Second Level Address Translation: Yes
Data Execution Prevention Available: Yes
Visual Studio 2019
Windows Features On/Off (see attached - shows Hyper V / Virtualization enabled as per documentation):
WindowsFeatures
I tried this way too - adding the Virtual Machine Platform - same error
Android SDK Settings
Android SDK Version:
Could the issue be related to the Android SDK Tools - only showing Android SDK Command-line Tools versions 1.0 to 2.1?
Could the issue be related to Android Repository perhaps missing on the bottom right hand side?
I've now also included the Android SDK Repository under the tools - but this is still not coming through:
You should also check Virtual Machine Platform in Turn Windows features on or off. Also, note that the tutorial that you linked to use an Android device for USB debugging.
EDIT
Here are my Android SDK Manager settings
Platform Settings
Tools
I had also the same problem, but I have already fixed as next process.
disable both [Hyper-V] and [Windows Hypervisor Platform].
restart PC.
enable both [Hyper-V] and [Windows Hypervisor Platform].
restart PC.
I had exactly the same problem, so I went to my UEFI settings and I realized that my SVM Mode was disabled. I don't know what motherboard you have but for Gigabyte this usually is in:
M.I.T → Advanced CPU Core Settings → SVM Mode
Disable the hyper-v via the following command on command line and reboot.
bcdedit /set hypervisorlaunchtype off
Enable it back with the following command and reboot.
bcdedit /set hypervisorlaunchtype auto
Now my emulator runs!
It seems like there is some kind of conflict with virtualization as per this and it effects creating Linux VMs too but these steps clears it.
The answer by suzukimi is right but I provided the commands and some additional info.
I had the same problem, solved it by turning on the virtualization in the bios
I struggled with this issue for 2 days. I even installed Android Studio and run its own emulator to make sure the issue is not Xamarin. Finally it is solved. In my Dell laptop running Windows 10 with Hyper-V installed, there are two issues causing this:
Run Command prompt in Admin mode. type bcdedit. On the last entry all the way down, make sure hypervisorlaunchtype is Off. By default it is set to Auto.
To change this setting, type:
bcdedit /set hypervisorlaunchtype off
Make sure to run the emulator on the laptop screen. Not on any other monitor. Somehow Android emulator crashed my laptop graphics driver when it is on other monitor.
I had same issue after I brainlessly type some command which ADB I think recommend it to me. After a while a realize, that even WSL does not work (Ubuntu in WSL and Docker) so I started to troubleshoot this one and finaly find solution
DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
bcdedit /set hypervisorlaunchtype auto
source
this typing in powershell fix all issues for me with Hyper-V and WSL
I had the same issue turns out the issue was that the intel HAXM wasn't installing properly from the SDK manager window.
So I downloaded the Installer directly from the repo. and installed it via the exe.
here: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Restarted Visual studio. Worked perfectly.
Go to BIOS and enable Virtualization Technology and of course also make sure the Windows Feature (Hyper-V is installed - all components).
In my case, BIOS was reset when I changed my CPU battery.
This recently happened to me. After some research, I discovered that Microsoft Hyper V was the issue, but the machine I was trying to use it on was Windows 10 Home edition. It had to be Professional, Enterprise, etc. It's not compatible with the version of Windows. Hope this helps.

Cannot start the emulator for Windows Phone 8.1

this is the error I get when I try to launch the emulator:
I have windows 8.1 professional, and the emulator as its shown is compatible with w8.1, and I installed the suitable VS update.
As the message suggests, you probably don't have Hyper-V enabled. If your PC supports it (which it should if the CPU isn't very old), you'll probably have to enable it from your BIOS (look up your motherboard or laptop model number for the exact location of the option in the BIOS).
On the off chance that it's enabled there but disabled from Windows, type "Turn Windows features on or off" from your Windows search charm and see if the Hyper-V option is checked or not. If the option isn't there at all then it's probably disabled from the BIOS or not supported by your CPU.
Also make sure you are running the 64 bit version of Windows 8.1 Pro. From the error shown it sounds like you may have the 32 bit OS installed.

Update to Android SDK Tools 23.0.5 and avd doesn't start

I am running on Windows 8.1 x64, developing Android apps using ADT Bundle. Previously (before updating the Android SDK Tools) the AVD was working very correctly and after the update, it says the following error while starting the AVD
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!
I tried to delete the avd, avd-folder from the windows user-specific folder and re-created the similar avd but no progress.
How can I run the avd again? (after the SDK update)
Create emulator in CPU/ABI in ARM, this error only exist for Intel processor.
If you want to create AVD CPU/ABI in Intel gor for this process,
Make sure you have instaled HAXM installer on your SDK Manager.
After you download it make sure you run the setup located in: {SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe
If you get the error "VT not supported" during the installation disable Hyper-V on windows features. You can execute this command dism.exe /Online /Disable-Feature:Microsoft-Hyper-V. You will also need "Virtualization Technology" to be enabled on your BIOS
I've run into the same problem here and in my research I was able to find a documentation on the android developer site that helped me out with this.
Start the Android SDK Manager, select Extras and then select Intel Hardware Accelerated Execution Manager.
After the download completes, run [sdk]/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM.exe
Follow the on-screen instructions to complete installation.
After installation completes, confirm that the virtualization driver is operating correctly by opening a command prompt window and running the following command:
sc query intelhaxm
You should see:
SERVICE_NAME: intelhaxm
...
STATE : 4 RUNNING
...
Refer to this documentation here: Using the Emulator - Configuring VM Acceleration on Windows
Hope it helps.
I am having the same problem. I did change my BIOS and all previously, when I was running Windows 7. Now I'm up on 8.1 and the VT-x is not supported. Thus, apparently it does not work on Windows 8. Intel link. Go down the page and it lists the Windows Operating Systems that it does support.
It also states that on the developer's page Android Developer's Using the Emulator; I have been researching other options, see this stackoverflow question, but when I check my BIOS it does not state "Intel Virtualization Technology" just "Virtualization Technology". I'm not sure at this point if my computer runs this or not. It should as it's an Intel i7.
Start the Android SDK Manager, select Extras and then select Intel Hardware Accelerated Execution Manager.
After the download completes, execute /extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM.exe.
Follow the on-screen instructions to complete installation.
After installation completes, confirm that the virtualization driver is operating correctly by opening a command prompt window and running the following command:
sc query intelhaxm
You should see a status message including the following information:
SERVICE_NAME: intelhaxm
...
STATE : 4 RUNNING
...
FIXED
If you are having issues with the HAXM and it's not working to do what everyone else is saying to do try this:
1.Make sure you've already tried the steps above
(Enable Virtualization in the BIOS, as well as Uninstall and Re-Install the HAXM option from the SDK Manager)
Exit out of Android Studio.
Download and Instal HAXM DIRECTLY from Intel.
https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager
Start Android Studio.
Voila!
On Android Studio 1.3 this worked for me:
Go to Tools -> Android -> SDK Manager
There under Appearance & Behavior -> System Setting -> Android SDK
From there click on the SDK Tools tab
You should see Intel x86 Emulator Accelerator in the list.
Mine was not installed. I clicked the check box to install it.

Unable to start the Windows Phone Emulator

I've seen this error several times. Each time I google deeply and finally made me reinstall my windows and all stuffs. Please help, I don't want to reinstall everything again. The error is:
Windows Phone Emulator
Unable to start the Windows Phone Emulator
Windows Phone Emulator is unable to start because
the hypervisor is not running. The likely cause is
that hardware-assisted virtualization is not enabled.
Check your computer's BIOS to ensure that hardware-
assisted virtualization and hardware-assisted data
execution features are enabled.
But yesterday I debugged really normally on Windows Phone using Emulator and I really sure
I've turned on Virtualization in BIOS and also in Turn Windows features on or off :
Sometimes when I hit f5 the IDE come with another error: 0x80131500
My PC: windows 8.1 ultimate 64b, 4gb ram, i3, Visual Studio 2013 RC3
Finally after struggling all day, I solved it ^^
I post the solution here so that somebody don't have to waste time just like me to solve such a silly error!
Just simple disable Hyper-V option in Turn Windows features on or off
(you could open this by hit the combination Windows + S, this will open the search box, then type "Turn Windows features on or off"
restart your PC
enable the Hyper-V option by using the same way as step 1.
Enjoy coding :D
If the accepted answer doesn't work for you - as it unfortunately did not for me - also be sure to enable Data Execution Prevention (DEP) in your BIOS.
The article below outlines what BIOS settings to enable for Hyper-V:
https://msdn.microsoft.com/en-us/library/windows/apps/jj863509%28v=vs.105%29.aspx
In my case, I had hardware-assisted virtualization enabled in the BIOS, but not data execution prevention (DEP). I also had Hyper-V enabled via Windows Features. After enabling DEP in the BIOS, I was able to run the Windows phone emulator.
CMD with admin rights:
bcdedit /set hypervisorlaunchtype auto
and reboot.

windows phone emulator not supported due to graphics processing unit configuration (windows 7 on mac)

I'm getting an error when I start up the windows phone emulator:
windows phone emulator not supported because your computer does not have the required graphics processing unit configuration. An XNA framework page will not function without a graphics processing unit. Do you want to continue starting the emulator?
And when I attempt to access a web page (any web page) - I just get a blank screen. How do I resolve this?
I'm running windows 7 on a mac.
Check out the system requirements for the emulator on MSDN.
Start by updating your graphics drivers to the latest available. If that doesn't work the next step would be to upgrade the graphics card, if you can.
A PC which won't run the emulator can probably still be used to develop and debug on a real device.
It may be you're also trying to run the latest SDK 7.1 which is far more restrictive than 7.0. If you find yourself unable to run 7.1, dropping down to 7.0 may work on your particular machine.
If you are running Windows 7 on a Virtual Machine on Mac OS X it won't work because there are some restrictions on running a Virtual Machine inside a Virtual Machine.
The quick and easy solution for this is installing Windows 7 in bootcamp, it worked for me.

Resources