Windows 10 21296 AMD - Android emulator WHPX error - android-emulator

I wanted to spin up an Android emulator, and always got the message The emulator process for AVD was killed
After trying to run it manually from within the command line, I got the following errors.
WHPX: Failed to get virtual processor registers, hr=c0350005
WHPX: Failed to emulate PortIO access with EmulatorReturnStatus: 64
WHPX: Failed to exec a virtual processor
This used to work on previous versions of Windows Insider, now it doesn't.
Is there anything I have to do?

It's a Windows bug that has been presented recently. There is no known solution so far.

The temporary fix is to turn off hypervisor until a Windows update is released. Windows 10 21296 has a known issue.

You can go to your windows setting --> Update & Security --> Troubleshoot --> Additional troubleshooters --> Program Compatibility Troubleshooter --> choose Android Studio, now it will open and you can start your Emulator, now it come a reboot message --> reboot it and now it should works

Related

Could not receive a message from the daemon in Flutter

I know this message has been already asked before but none of the answers has fixed my issue,
The error message:
I have already tried disabling the hotspot of my emulator (which is a Pixel XL API 30) but it doesn't work. I have also tried restarting my pc, IDE and emulator and also changing my IDE from vs code to Android Studio but the error doesn't go away. I am new to flutter and I don't want to give up at the start!
Disable your mobile hotspot. If you use windows 11 that was my error try, will run normally easy like this.
For me, it was the Windows Hotspot Wifi as "#Salah dine Maham" said.
As I know it is related to a gradle issue (shows up from about gradle v6.3), I went to the
android/gradle/wrapper/gradle-wrapper.properties
I updated the distributionURL into :
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip
You "may" need to update the gradle plugin on the android project.
And now you can debug again freely through Windows Hotspot wifi.
So, as I said I couldn't find any solutions but here it is:
delete ANY VMware processes or, if you can, unistall VMware and use virtualbox instead, even if vmware is not running it will confict with other emulators.
Credits

Android Studio: The emulator keeps crashing after sometime

Every time I run the emulator it runs normally at the beginning but after a couple of minutes it crashes and it's giving me this error:
emulator process finished with exit code 1073740791 (0xC0000409)
I am using windows 10 home edition. virtualization is enabled in bios. I don't have any other virtualization software installed (like virtual box).
any idea why this is happening?
It seems a buggy graphic card driver can cause a similar problem. I am not sure if this is generated your problem here or not, but it is worth to say; If you have an NVIDIA graphic card with the driver version of 378.49 (there may be other versions too!), you may experience this error due to some incompatibility with java.
Please update your graphic card driver or rollback it to version an older stable version and try again!. And read here for more information.
I might have an Idea what your problem is:
Restart the adb Server, you can do so by using the command Prompt in the following way:
First go to C/users/(YOUR USERNAME)/AppData/Local/Android/Sdk/platform-tools with the cd command.
Then just type adb kill-server, and adb start-server, so like this;
cd C/users/(YOUR USERNAME)/AppData/Local/Android/Sdk/platform-tools
adb kill-server
adb start-server
If that doesent work try to wipe and cold boot described in this question.
Try this :
Go to Tools ==> SDK Menager ==>Android SDK
(Appearance&Behavior=>System settings=>Android SDK)==>SDK Tools==>Intel x86 Emulator Accelerator(install this).
It will solve your problem.I hope it helps.
Here are a few things you can try:
Go to AVD manager and open settings for your virtual device. In the Emulated Performance section for graphics, change it from automatic to software.
Have a look at here. There could be an incompatability with other software incompatibility with other software such as Docker, Oracle Virtual Box and other products that use VCPU.
You could try a complete reinstall of Android Studio and make sure all updates are completed. There could be a bug in an older version of the emulator you are using that's fixed in a more recent release.
Edit
A couple more things you could try:
Open Android Virtual Device Manager, then click on options for virtual device, then wipe data, then cold boot.
Go to C:/users/(username)/AppData/Local/Android/Sdk/platform-tools in a terminal, then type adb kill-server, then adb start-server.
Edit
You could also try checking for memory leaks https://developer.android.com/studio/profile/memory-profiler and you could try increase the amount of RAM available for the emulator.
Go to Tools->Android->AVD Manager, then edit your AVD, then in the pop-up window click Show Advanced Settings, then finally increase the amount of RAM.
Edit
IT could be an issue with libGL or libstdc++. See here
It sounds like the emulator may have not installed correctly. Check these steps:
Ensure that you have installed Hyper-V . Documentation for running emulator on AMD
Then try this step to force a cold boot:
Android Studio Emulator and "Process finished with exit code -1073741511 (0xC0000139)"
If Its crashes again, then create a new emulator. You might also try and download a new image just to make sure that the one you installed is not corrupt.
You said you're using Windows 10? Error code 0xC0000409 is caused by a stack buffer overflow. It seems to have popped up a couple places all related by windows systems (might be totally irrespective of the android emulator). If this is the case I found a couple threads that might help solve your problem.
http://www.cplusplus.com/forum/windows/39061/
https://answers.microsoft.com/en-us/windows/forum/all/werfaultexe-the-exception-unknown-software/627da5c0-004a-e011-8dfc-68b599b31bf5?auth=1
http://windowsbulletin.com/solved-exception-code-0xc0000409-error/
https://www.tenforums.com/tutorials/16397-repair-install-windows-10-place-upgrade.html

emulator broken: This adb server's $ADB_VENDOR_KEYS is not set

Well a windows 10 update broke sleep, the computer went to sleep with the emulator open and now that's broken. When I run an app to launch in the emulator it will boot the emulator but won't install just time out. When I try and run an app into a running emulator instance Studio says:
com.android.ddmlib.AdbCommandRejectedException: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Error while Installing APK
I've followed some of the other threads here. I've tried changing
the environmental variable in control panel, but in fact I think it
pointed to the right place originally, where the sdks are these
days.
I've tried restarting the PC. I did try deleting a couple of
adb files, that didn't work.
I've tried deleting all the sdks and
downloading them again.
I've tried uninstalling and updating Android
Studio, several times. Now on AS 3.1, still not working.
Bit of a nightmare really.
How do I set the vendor keys? Using AS console commands? Can anyone point me to a dummies guide, this is a bit of a tangent for me, wish I could fix it from the GUI.
The working fix for this particular issue is to enable Developer options on your emulator and enable "USB Debugging".
OK so eventually downloading a nexus 4 x86 image android 27, with no play store worked. Sorry if this is repetition. Long live working emulators
Combining answers from here and there gives an answer that also worked for me in IntelliJ IDEA. I assume the issue is the same, since the emulator and AVD is the same.
Option 1:
Restart the emulator from AVD
Option 2:
Wipe the emulator data
Option 3: Stop the emulator. Then make sure it is up to date and try again.
If it still does not work, restart the adb server and retry.
adb kill-server && adb start-server
If it still does not work, perhaps your adb is out of date... somehow. This was the case for me. Running the following fixed that for me.
adb devices
adb server is out of date. killing...
* daemon started successfully *
List of devices attached
emulator-5554 device
If it is now working for some emulators but not newly created ones, take note of the message in the emulator selection box: "Press Ok in the Allow USB Debugging Dialog"
Sadly, there is no such dialog. So go and enable Developer Mode in the settings of your emulated OS by tapping the Build Number several times. Then go to the Developer Settings and enable USB debugging.
After recent upgrades of emulator, the virtual device*) stays unauthorized. When I cold boot the emulator, sometimes I see the expected confirmation dialog, but this dialog goes away immediately, leaving no chance to click 'OK'.
We're aware of this problem and plan to fix it soon.
* Here, I was running x86 with API 28 and Google Play on Windows 10. I don't know which other scenarios are effected.
For anyone who might encounter this in the future -- I mean the ultimate issue of receiving the error, "This adb server's $ADB_VENDOR_KEYS is not set" despite not having any (or any sufficient) opportunity to click OK...
Resolution: In the Developer Settings, select the option to, "Remove existing authorized adb keys on device." Repeat the previous action -- the prompt will once again appear, as if the very first time.
-Mike
Go to developer options in your device and click on 'Revoke USB debugging authorizations'. Disconnect and reconnect your device. You'll get a prompt on your device to authorize your computer to connect to your device. click on 'OK' and your set.
Basically, the authorization key has gone out of date or it's no longer present. So, we just have to set a new autorization key and revoke the old ones.

Error : DEP6200 : Bootstrapping 'Device' failed. Device cannot be found

I've read every StackOverflow that I could find on this issue, but I still can't work it out.
I'm trying to deploy an app to actual device (NOT emulator). But I receive the following error when i try to build:
Severity Code Description Project File Line
Error Error : DEP6100 : The following unexpected error occurred during bootstrapping stage 'Connecting to the device '30F105C9-681E-420b-A277-7C086EAD8A4E'.':
SEHException - External component has thrown an exception. App1
and
Severity Code Description Project File Line
Error Error : DEP6200 : Bootstrapping 'Device' failed. Device cannot be found. App1
It's worth mentioning that I went from Windows 7 to Windows 10. It's also worth mentioning that my computer was missing the IpOverUsbSvc.exe (not just the registry post, but the actual service was missing). Couldn't find any way to get this back so, so my colleague sent over the .exe and the DLLs and I placed it in it's location. And the service is now running and no longer gives any errors. My device is recognized by the PC, it's running Windows 10 Mobile (but I've also tried with a device running Windows 8.1).
Specs on PC:
Windows 10 Pro (Build 10240)
Using Visual Studio 2015
UWP Tools
Any suggestions to fix my nightmare? Thanks!
Steps that helped me. I have windows 10 mobile build 10581 (and now 10586) installed on phone
Turn off Developer mode on your phone.
Deploy app (UWP or SL) by VS2015 -> Error.
Turn on Developer mode on your phone.
Deploy app (UWP or SL) by VS2015 -> Working.
If you change another device or re-connect you must close VS2015, re-launch and do again!
Finally managed to find a solution to this illusive bug.
It seems that if I didn't have the Windows Phone 8.1 Tools installed I couldn't build to an ARM device (not even Windows 10 Mobile).
So my step to solve this was:
Go to Control Panel -> Programs and Features -> Microsoft Visual Studio ... 2015 -> Modify. And then select the Windows Phone 8.1 Tools.
Pretty pissed that one can't get a reasonable error message when things like this is missing.
I had this issue after updating my device to win10 ver:10.0.10581.0. I tried many things but finally after installing latest sdk and emulators i got it working. You may try installing from this page sdk and emulator:
https://dev.windows.com/en-us/downloads/windows-10-developer-preview
Somehow the new emulators were not visible in vs, they got visible after few restarts and then on device debugging started to work.
But one problem still remain from me that vs crashes after ending debug session with device.
desktop-->my computer--> right click--> management--> service--> start the service Windows Phone IP over USB Transport (IpOverUsbSvc) although maybe the starttype is set as automatic
Seems like there are many issues causing the same error message.
This one worked for me Windows Phone deploy Issue
Essentially you need to remove/uninstall the device from Windows. Then after unplugging and plugging back in, the device and drivers are reinstalled.
I tried many of the suggested solutions to no avail.
After changing the USB-C cable from a USB 3.1 port to a USB 2.0 port on my computer, the error goes away. YMMV
I see it is quite an old post...but I still get this problem. In my case, this happened after I deployed to a second phone I had for testing. After that, VS 2017 now only wants to deploy to that phone and not to the other phone no more. If I start another project, the other phone is recognized and deployable to (listed as device under debug).
Restarting system fixes this...
Also, if I add another project as reference (like a background task) to my project, I will loose the ability to select the devices and emulators under debug. VS 2017 simply then seems to deploy to the last device selected...(really no clue what this is). I have not been able to get the selection of emulators and devices back yet on this one. I only will have the "Start" and "Download new emulators" options. I think this has to do with the fact that VS maybe doesn't know the type (like arm/86/64) of the reference project because it is not set (not needed as this defies the purpose of referencing a project for dynamic references and not the compiled device specific file...)
Hope it helps someone ....
I uninstalled the existing version of the app in device and re-ran it and it worked for me
I got that error for a really simple reason...just opened a new solution I downloaded from GitHub, pressed F5, and got it!
I had left my build configuration in the default "Debug - ARM" setting, when I changed to "Debug - x64" it worked fine!
(Just adding another reason for completeness, not likely to affect your case!)
In case it's helpful for others... I got: DEP6701 bootstrapping failed ... access denied.
Thanks to comments here, I only dev-locked then dev-unlocked my phone (was originally dev-unlocked). Totally works now (took some time installing missing frameworks at first). All good.
Thanks
One more thing could be tried.
Uninstall the existing app if any and then deploy from Visual Studio.
Try on another usb port. It worked

Intel HAXM installation error - This computer does not support Intel Virtualization Technology (VT-x)

I have an issue with my HAXM installation. Here is the thing. I got this error every single time I tried to install HAXM for my computer:
Problem is, that my computer supports Virtualization Technology (see pic below). Any idea how to fix this issue?
Just follows these steps:
Go to Control Panel → Program and Feature.
Click on Turn Window Features on and off. A window opens.
Uncheck Hyper-V and Windows Hypervisor Platform options and restart your system.
Now, you can Start HAXM installation without any error.
Hello and welcome to the 3rd installment of the infamous Android Emulator on Windows saga. Despite the combined 3 trillion dollar market cap of Microsoft and Google, this remains to be a problem harder than going to the moon.
Below is the somewhat comprehensive list for Windows (so far as of circa 11/2022)
First make sure you have the latest version of Windows. As of writing, this is Windows 11 22H2 with all updates installed. If you have an older version of Windows, you'll have to try each one of the below, with possibly different combinations. Otherwise follow from the top until your issue is solved. It is ordered from the easiest/most likely culprit on a decent Windows machine, to the most unlikely cause.
Note that if you're doing below on a corporate machine, some of the below actions may be blocked by your admin, and/or flag your machine as suspicious activity as some actions intentionally turns off some security features. Depending on your situation, you may want to give a heads-up to your IT/security team.
If your Windows device has Bitlocker enabled on your boot drive contact your IT admin first. Messing with virtualization and boot configuration may trigger bitlocker prompts upon reboot. If you're working from home,this may mean taking your laptop to the office to get it unlocked by IT, as Windows may refuse to boot without unlocking BitLocker.
To find what is blocking the emulator launch, the surefire way is to open a terminal (cmd or powershell) and launch to from there as below.
First kill any existing emulator.exe instances, adb.exe instances, java.exe instances, qemu instances, android studio instances. Check in task manager to be sure.
The adb relaunches itself so its ok be running. But make sure android studio is not running. It seems to lock files/cache and not flush emulator configs, that may crash the emulator at launch, without any useful logs.
in a terminal
cd your_sdk_location\emulator
emulator.exe -list-avds
this will list what AVDs you have. Find the one you want
emulator.exe -avd your_avd_name -verbose
This will have a long log, and will have some information on what the failure is. If you see a VM heap size being outside of limits, it may say that it it automatically set to lowest or highest value. This is a lie. Open emulator settings and set it to within the limits manually, usually 550MB works. Launch android studio and edit the emulator instance to be within this limit, then close android studio, then wait about 30 seconds before attempting to launch the emulator. For all attempts of launching the emulator below, do not rely on android studio, launch from command line instead.
Note that the emulator editor UI in android studio can corrupt the config at times. If this happens, I don't know where this is stored, so you may have to delete and re-create the AVD. If this doesn't work, do not change and configs during AVD creation, then launch it from command line.
If the emulator doesn't launch, no useful failure logs, yet the emulator.exe exits after a few minutes, you may have android studio running. Exit/Kill Android studio, wait a minute or so and try again. If still fails, reboot.
Have an Antivirus (other than Microsoft Defender)?
Disable it
Reboot and try to launch the emulator
Disable Hypervisor Boot
open an admin terminal (cmd or powershell)
run bcdedit /set hypervisorlaunchtype off
try to launch the emulator. If still broken, try rebooting.
If your failure is due to install of HAXM/AMD hypervisor driver failing
run systeminfo in a terminal
at the end under Hyper-V Requirements: if it says A hypervisor has been detected this means emulator cannot launch virtualization.
Open Start > Windows Security > Device Security > Core isolation
turn off Core Isolation (previously known as Memory Integrity/Isolated User Mode)
Open Turn Windows features on or off and disable
Hyper-V Platform
Hyper-V Management Tools
Windows Hypervisor Platform
You can enable them after HAXM/AMD Driver install
on an admin prompt run bcdedit /set hypervisorlaunchtype off
reboot
try to launch the emulator
Check BIOS
go into BIOS/UEFI setup and look for settings like
VT-x
VT-d
Virtualization Technology
Hardware Virtualization
Make sure these settings are enabled
try to launch the emulator
Uninstall Docker Desktop
Some users have reported that uninstalling Docker Desktop fixed their issue.
It is unclear as to why docker desktop interferes with haxm installation. The reason is probably that it supports running docker images via a Hyper-V backend, and disabling this feature does not remove the hypervisor completely.
Go to Settings -> Add or remove programs, and uninstall docker desktop
reboot
try to launch the emulator
Nothing works
You shouldn't get here, since Android emulator can now run alongside with Hyper-V if you have 'Windows Hypervisor Platform' enabled.
If nothing above works, as a last resort you can try running Android in a Hyper-V VM and get ADB to connect to it. (Not a solution, but a workaround)
You can also run android using a third-party emulator like Genimotion.
¯\(ツ)/¯
Debug on a physical device
You can also use Wifi debugging via adb pair ip:port and adb connect ip:port commands.
or get a Macbook
After few days of googling I found, that problem was caused by hyperthreading (or hyper - v). I decided to edit my boot.ini file with option to start up windows with hyperthreading turned off.
I followed this tutorial and now everything works perfect
chances are that you have windows 8 with hyper-v installed? if yes remove hyper-v and your problem goes away!
First of all make sure you enabled Virtualization Technology in your BIOS. After restarting your computer press F1-F12 on your keyboard and find this option.
Make sure you disabled Hyper-V in your Windows 7/Windows 8. You can turn it off in Control Panel -> Programs -> Windows functions
You can try to disable your antivirus program for the whole installation process. Remember to restore all antivirus services after installing HAXM.
Some people recommend cold boot which is:
Disabling Virtualization in your BIOS
Restart computer and turn it off
Enable VT in your BIOS
Restart computer, turn it off
It's likely that now might be allowed to install HAXM
Unfortunately this step didn't work for me
Last but not least: try this workaround patch released by Intel.
http://software.intel.com/en-us/blogs/2013/04/25/workaround-patch-for-haxm-installation-error-failed-to-configure-driver-unknown
All you have to do is to download the package, unzip it, put it together with HAXM installator file and run .cmd file included in the package - remember, start it as an Administrator.
I had a lot of problems with installing HAXM and only the last step helped me.
In the "Turn Windows features on or off" window, un-check Hyper-V and also ensure that Windows Hypervisor Platform is unchecked. Windows Hypervisor Platform being enabled can also block the installation of the Intel HaxM
Maybe VT-X is not enabled in your BIOS.
See Intel HAXM documentation here: http://software.intel.com/en-us/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows
Intel VT-x not enabled
In some cases, Intel VT-x may be disabled in the system BIOS and must
be enabled within the BIOS setup utility. To access the BIOS setup
utility, a key must be pressed during the computer’s boot sequence.
This key is dependent on which BIOS is used but it is typically the
F2, Delete, or Esc key. Within the BIOS setup utility, Intel VT may be
identified by the terms "VT", "Virtualization Technology", or "VT-d."
Make sure to enable all of the Virtualization features.
Anti-virus software may interfere with the HAXM installation.
After trying to figure out what went wrong for a few hours I found a strange solution - uninstalling my anti-virus software , installing HAXM (which worked) and then re-installing the anti-virus software (Avast in my case but it could happen with other anti-virus programs as well.
The full check I went through to get this running is:
Check the 'Virtualization' and vt-X feature in the BIOS.
Verifying Hyper-V is not installed.
Checking weather vt-X is enabled in windows with the Intel tool and MS tool (mentioned in previous posts in this thread).
Disabling the anti-virus which didn't help.
Uninstalling the anti-virus (which solved the problem for me).
In Windows 10, Windows Defender has a feature of core isolation which uses virtualisation technology that will also interupt in working of HAXM. Disable it and try again. In my case disabling it solved my issue.
If you have an AMD Ryzen processor in your computer you need the following setup requirements to be in place:
AMD Processor - Recommended: AMD® Ryzen™ processors
Android Studio 3.2 Beta or higher - download via Android Studio
Preview page
Android Emulator v27.3.8+ - download via Android Studio SDK Manager
x86 Android Virtual Device (AVD) - Create AVD
Windows 10 with April 2018 Update
Enable via Windows Features: "Windows Hypervisor Platform"
Note:There is Hyper-V features... You should enable Windows Hypervisor Platform not Hyper-V.
Windows Hypervisor Platform is at the bottom
After conditions done avd x86 work without haxm install
Reference
In many cases some antivirus also start HyperV with window start and does not allow HAXM to install.
I faced this issue because of AVAST antivirus.
So I uninstalled AVAST, then HAXM installed properly after restart.
Then I re-installed AVAST.
So its just a check while installing as now even with AVAST installed back, HAXM works properly with virtual box and android emulators.
After I installed Visual Studio 2013 Update 2, Visual Studio notified me about a Windows Phone emulator update, which I installed (it was really a new component, not an update). It turned out this enabled Hyper-V, which broke HAXM.
The solution was to uninstall the emulator from Programs and Features and to turn off Hyper-V from Windows Features (search for "Windows Features" and click "Turn Windows features on or off").
If you dont find Hyper-V option in control panel as said in other responses here, try entering BIOS setup (restarting and pressing F-12 or ESC or other depending on your PC) and enabling Virtualization, located probably in CPU options.
I'm running Windows 10 and had this problem after I changed my SSD, I fixed it by disabling the VT support on Bios. I got a different error after I ran the installer. I rebooted and enabled VT support again and voila, working now.
If any of the answers doesn't work just remove Android Emulator and reinstall it again. and after that try installing Intel Haxm.
If none of the answers worked out for you, try this,
Hyper-V might not be disabled
If you have windows 10 features such as Device Guard and Credential Guard is enabled, it can prevent Hyper-V from being completely disabled.
The Device Guard and Credential Guard hardware readiness tool released by Microsoft can disable the said Windows 10 features along with Hyper-V:
Download it here, https://www.microsoft.com/en-us/download/details.aspx?id=53337
Download the latest version of the Device Guard and Credential Guard hardware readiness tool.
Unzip
Open the Command Prompt using Run as administrator
#powershell -ExecutionPolicy RemoteSigned -Command "X:\path\to\dgreadiness_v3.6\DG_Readiness_Tool_v3.6.ps1 -Disable"
Reboot.
I already tried all of the possible solutions on stackoverflow and didn't work
What I tried:
Disable Hyper-V in windows feature
Disable Hyper-V with command
Disable Device Guard
etc etc
Above solution still give me information about Hyper-V in System Information and the HAXM still failed to install.
But finally I found the solution, you have to disable Hyper-V from System Configuration:
Open System Configuration
Click Service tab
Uncheck all of Hyper-V related
Check System Information then Hyper-V is off now
Fix the error. follow the following steps
Turn off Hyper-V and Windows Hypervisor Platform
Goto RegEdit "Windows Defender is blocking HAXM."
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceGuard
Set the key EnableVirtualizationBasedSecurity to '0'
if Key is not available create a key
Re-boot the machine
Install the intelhaxm-android.exe