I facing an error while running any emulator with android studio avd manager:
...AppData\Local\Android\Sdk\emulator/emulator-x86.exe: invalid option -- '-enable-whpx'
android studio version is 3.1.3
android emulator version is 27.3.9
Hyper-V and Windows Hypervisor Platform are active on my windows 10
and the WindowsHypervisorPlatform = on flag is set ...sdk\emulator\lib/advancedFeatures.ini
this is a part of verbose mode:
emulator: Checking whether Windows Hypervisor Platform (WHPX) is available.
emulator: Could not load library WinHvPlatform.dll
emulator: WHPX is either not available or not installed.
emulator: CPU Acceleration: working
emulator: CPU Acceleration status: HAXM version 7.2.0 (4) is installed and usable.
Windows Hypervisor Platform is checked in the windows features and the WinHvPlatform.dll is present in C:\Windows\System32
how can i enable or install WHPX ?
My problem solved by simply changing the emulator engine.
According to documentation you can specify the emulator engine with the -engine flag. the mentioned error occur using the classic engine. when i changed the engine to auto or qemu2 the emulator started with no error. to change the engine go to .../sdk/emulator directory with the command line and run:
emulator.exe -list-avds
this will output you virtual devices name
then run:
emulator.exe -avd YOUR_DEVICE_NAME -engine qemu2
or
emulator.exe -avd YOUR_DEVICE_NAME -engine auto
I hope this will help you.
Related
today, suddendly, all my Android Emulators (on Win10 / IntelliJ IDEA),
started complaining about a missing library.
When i launch any emulator, during loading, i read on the console log:
Emulator: Could not load library 'WinHvPlatform.dll'
then, the emulator starts and seems to run OK.
But... does anyone have an idea what it could be the cause ?
What is that library ?
It's because Microsoft has worked with Google to allow using Hyper-V instead of Intel HAXM as hypervisor. See these articles:
https://blogs.msdn.microsoft.com/visualstudio/2018/05/08/hyper-v-android-emulator-support/
https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration
The Windows Hypervisor Platform was introduced in the Windows 10 April
2018 Update and enables third-party virtualization stacks to utilize
the Windows Hypervisor for hardware acceleration. If you are using
Hyper-V, this stack replaces Intel HAXM as the hypervisor for the
Android emulator.
If you run the ANDROID_SDK\emulator\emulator.exe -avd YOURAVD -verbose you might get this output:
emulator: Checking whether Windows Hypervisor Platform (WHPX) is available.
emulator: Could not load library WinHvPlatform.dll
emulator: WHPX is either not available or not installed.
emulator: CPU Acceleration: DISABLED
emulator: CPU Acceleration status: HAXM is not installed on this machine
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
You could follow the instructions in the above posts to turn off Windows Hypervisor for Google's Android emulator in %USERPROFILE%\.android\advancedFeatures.ini by setting:
WindowsHypervisorPlatform=off
Hyper-V should be disabled for the Android emulators, and use Intel HAXM instead (if your processor supports it). Also make sure you are using the updated Android SDK 27 tools and emulators, they can be updated as explained in this article.
Cannot launch AVD in emulator.
Output:
emulator: WARNING: Classic qemu does not support SMP. The hw.cpu.ncore option from your config file is ignored.
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAXM must be updated (version 1.1.1 < 6.0.1).?
[PS I have installed Intel 86 emulator accelerator(HAXM installer) 6.2]
Install HAXM and setup as detailed in the link below:
https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows
The Alternate Solution could be the Genymotion for personal use
https://www.genymotion.com/fun-zone/
you can use genymotion for your emulator
Problem:
I'm using only command line tools. AVD just worked fine some time ago. Now with various configurations I get only "Starting emulator for AVD..." which simply closes without any error messages and leaving emulator.exe in Task Manager for eternity.
What I've tried:
Various devices, API's, RAM above and below 768, with/without Host
GPU etc;
Reinstall Java;
Reinstall Android SDK;
Run emulator from command line just launches emulator.exe without any errors;
Delete .android folder in User's folder;
Set ANDROID_SDK_HOME variable;
Run SDK Manager.exe/AVD Manager.exe with/without elevated Admin rights;
verbose key gives me the following log:
emulator:Found AVD name 'jkll'
emulator:Found AVD target architecture: arm
emulator:Auto-config: -engine classic (arm default)
emulator:Looking for emulator-arm to emulate 'arm' CPU
emulator:Probing program: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:return result: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:Found target-specific 32-bit emulator binary: C:\Soft\Android\android-sdk\tools/emulator-arm.exe
emulator:Adding library search path: 'C:\Soft\Android\android-sdk\tools/lib'
emulator: Found directory: C:\Soft\Android\android-sdk/add-ons\addon-google_apis-google-17\images\armeabi-v7a\
emulator: Found directory: C:\Soft\Android\android-sdk/add-ons\addon-google_apis-google-17\images\armeabi-v7a\
Configuration I am working on:
Windows 10 x64
Android SDK Manager 25.1.1
Java JDK 8 Update 91
i5 CPU with 24GB of RAM
Any suggestions? TY.
I tried all the mentioned solutions. But strangely, I reduced my windows 10 laptop's resolution (from 3840 x 2160 to 1360 x 768) and it worked.
With your verbose I found you are using arm architecture devices.As you are using i5 processor,Windows10 x64 I would Suggest you to use x86 or x86-64 architecture for your devices for this you have to Install Intel x86 Emulator Accelerator (HAXM) from SDkManager.
Hope this helps let me know.
After changed the CPU of my computer and updated sdk, I encounter this problem too.
Now I temporarily solve the problem emulator-x86 I get an error about missing Qt5Core.dll, Qt5Widgets.dll and Qt5Gui.dl:
copy *.dll files in sdk\tools\lib\qt\lib to sdk\tools where the emulator-x86.exe in.
I have a Mac Book Pro - Intel i7. I am trying to create a AVD with the accelerated Intel Options but i get the following error every time i open the AVD.
Starting emulator for AVD 'AVD_for_Nexus_5_by_Google'
emulator: Failed to open the hax module
HAX is not working and emulator runs in emulation mode
emulator: emulator window was out of view and was recentered
AVD Settings
Such error: Windows Solution
Install the HAXM Driver by running "IntelHaxm.exe". It will be located in one of following locations.
..Android\android-sdk\extras\intel\Hardware_Accelerated_Execution_Manager
..adt-bundle-windows-x86_64\sdk\extras\intel\Hardware_Accelerated_Execution_Manager
Go to the directory of extras and run the installation of HAXM. It will solve your problem.
Such error: Mac Solution
Go to this link.
Choose the Intel HAXM installer package for your platform.
Extract the installer and follow installation instructions for your
platform.
I have Intel HAXM installed on my machine along with Atom image. When I fire-up emulator in Android Studio, don't see anything that would tell me if Intel HAXM is being utilized or not.
According to the screenshots on Intel's website, in Starting Android Emulation window in Eclipse, it show a message, informing that Intel HAXM is being utilized.
If your emulator is running with HAXM, you'll see output like this in your run console in Android Studio, with the relevant line being the "HAX is working" bit:
Waiting for device.
/Users/sbarta/sdk/tools/emulator -avd x86-API10 -netspeed full -netdelay none
HAX is working and emulator runs in fast virt mode
Device connected: emulator-5554
Or, according to Intel's official Installation Instructions for IntelĀ® Hardware Accelerated Execution Manager:
To verify that Intel HAXM is running, open a Command Prompt window with administrator privileges (Run as Administrator) and execute the following command:
sc query intelhaxm
If Intel HAXM is working, the command will show a status message indicating that the state is: "4 RUNNING".
According to the Android Studio documentation you can run the following:
$ ./sdk/emulator/emulator -accel-check
And if you see the following you have it installed:
accel:
0
HAXM version 6.0.3 (3) is installed and usable.
accel
It's really easy. just open cmd and do what I did base on below image:
If you see the response like mine, it means that the Haxm is working.
If not running, make sure your processor is capable of running Intel HAXM. You must have VT and ND (aka nx no execute bit) ON in BIOS. (You can read out the nx bit from running bcdedit as admin). But you can't have certain other VT items running (including Hyper-V or VirtualBox).
There's an article on troubleshooting Intel HAXM at software.intel.com (search on HAXM).