Android studio's emulator doesn't start - android

7:45 PM Emulator: 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.
7:45 PM Emulator: emulator: ERROR: x86 emulation currently requires hardware acceleration!
7:45 PM Emulator: CPU acceleration status: Unable to open HAXM device: ERROR_FILE_NOT_FOUND
7:45 PM Emulator: Process finished with exit code 1

Couple things could be going on here. first off Im assuming you're not running it in some virtual environment so few things you could try
The issue might be your CPU hardware, if you have like a core 2 duo processor or something along the low lines like that then it probably does not support Extended Page Tables and Unrestricted guest(thats your EPT + UG error) try running on an API lower than 21 and see if it works you will still get warnings but it should work if that the case
if that isn't the case see if intel virtualization technology is turn on in your bios
try updating your HAXM(hardware accelerated execution manager) on your computer using resource file from the official site(software.intel.com) or whatever it is
or if you don't even have HAXM you can try installing it....
Installation of Intel HAXM consists of two steps. First, you need to download it using SDK manager. Then you need to run intelhaxm-android.exe to install Intel HAXM
also would help to know what kind of processor/cpu you have

Found a few links for the warnings:
For the first warning: Quick Boot not supported
For the others: HAXM errors

Install HAXM from "...sdkroot/ extras / intel" folder .Open the file 'intelhaxm-android.exe'
from this folder.If you don't have it download it.

Reverting back to 7.1 version of HAXM driver worked for me.
the rest are all warnings, so my Emulator showed up finally!!!
Thank you all for guiding.

Related

Android Emulator Error missing WinHvPlatform.dll

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.

Android Studio AVD not working HAXM not installing

When I'm running AVD and select a device to run, if I use armeabi-v7a then the loading screen appears and after it loads it just disappears and no virtual device shows up.
When I change it to x86 then I get this error
" Cannot launch AVD in emulator. Output: 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! "
So I installed it using SDK manager but I got this error
"Failed to configure driver: unknown error. Failed to open driver"
so I used this workaround patch
https://software.intel.com/en-us/blogs/2013/04/25/workaround-patch-for-haxm-installation-error-failed-to-configure-driver-unknown
but when I run "hax_extract" windows command script it just opens up and closes(I even turned off Firewall and Right now I dont have any antivirus installed either) and still I get the same errors when opening the emulator.
I'm using Windows 10 and according to "Intel(R) Processor Identification Utility" Virtualization is enabled.
Using Asus Z97 Maximus VII HERO mobo
Intel I7 4790k
Please help.
Firstly, make sure that you have enabled the VT in Bios. Notice that "Intel(R) Processor Identification Utility" just tells you that the Virtualization is supported, not enabled certainly.
Secondly, make sure that you have disabled the Hyper-V if you have used Hyper-V in your Windows. You can go to http://www.poweronplatforms.com/enable-hyper-v to disable it.
Under normal circumstances, the problem should be solved. However, if you still get same error, you can try this: disable secure boot in BIOS, and then install haxm. This is my final solution when I once encountered such problem.
Good luck!

HAXM Hardware Requirements

Do i need to upgrade my processor to run HAXM or have i missed something? If i have missed something, any hints would be greatly appreciated :)
My processor is Intel Core2 6300 # 1.86GHz 1.86GHz installed memory 4.00 Gb. Running on Win7.
I have enabled VT in the BIOS, but it is for 16 and 32 bits? Is this a problem?
I have run the intel processor identification utility, file pidenu39.msi from ...
Intel® Processor Identification Utility - Windows* Version
It tells me on the CPU Technologies tab that my processor does have Intel Virtualization Technology, but does not have VT-x Virtualization Technology with Extended Page Tables. Is this OK?
From this website , Configuring Virtual Machine Acceleration
i have followed all of the instructions under this heading ...
Configuring VM Acceleration on Windows
sc query intel haxm does indicate that the virtualization driver is operating correctly.
I am running the newest version of Android Studio. I am running the very simple Hello Android app from the Android Application Devekopment for Dummies book, chapter 3. Nothing complex or messy here :)
I get this message sequence ...
C:\AndroidSDK\tools\emulator.exe -avd Nexus_5_API_21_x86 -netspeed full -netdelay none
emulator: device fd:584
**HAX is not working** and emulator runs in emulation mode
emulator: The memory needed by this VM exceeds the driver limit
.
emulator: warning: opening audio input failed
creating window 39 53 300 532
../../sdk/emulator/opengl//host/libs/Translator/GLES_V2//GLESv2Imp.cpp:glAttachShader:156 error 0x501
../../sdk/emulator/opengl//host/libs/Translator/GLES_V2//GLESv2Imp.cpp:glAttachShader:156 error 0x501
Followed by many more error 0x501s
Just a note, but if you want to change the amount of ram that HAXM has available you can re-run the installation and it will allow you to alter the setting.
I found this out by accident when I was trying to update HAXM. The last page of the install tells you that you can change the setting by re-running install.
How much RAM is set for use inside your AVD configuration ? this number has to be lower or equal to the memory usage you have set during the installation of HAXM.
If I am not wrong you are using Android Studio, and there is an option for RAM size when creating virtual device from AVD , please read this, Managing AVDs with AVD Manager
Also, the default ram size is 96 megabytes.
I had the same problem with a similar processor, core i3, in my VAIO laptop. VT was also enabled on the BIOS and the problem was fixed when I uninstalled the avast anti-virus(no disabling the protection) and so I could finish the HAMX installation. After that, I installed the Avast software again.
I hope this issue can help more people.

HAXM not working on Linux

Here we go for GingerBread:
http://software.intel.com/en-us/blogs/2012/03/12/how-to-start-intel-hardware-assistedvirtualization-hypervisor-on-linux-to-speed-up-intel-android-x86-gingerbread-emulator/
Any updates for ICECream sandwich or Kitkat? Helpful answers are highly appreciated!!
HAXM is only needed on Windows and OS X. On Linux, you need to have KVM installed.
See the "Configuring VM Acceleration on Linux" section on:
https://developer.android.com/studio/run/emulator-acceleration#vm-linux
Just download x86 based system images in the SDK Manager, then start the AVD, KVM will be auto-detected and used automatically if your machine/system supports it.
As already mentioned by #Digit, you do not need HAXM on Linux but KVM.
Although the links in the other answers give a comprehensive answer, for those who like it short, on my Ubuntu, this was just enough:
sudo apt-get install kvm
KVM has to be enabled by inserting the kernel module:
sudo modprobe kvm-intel
How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux to Speed-up Intel Android x86 Emulator might help; verbose output is also useful for testing:
emulator -avd ... -verbose
should log something like:
emulator: CPU Acceleration: working
emulator: CPU Acceleration status: KVM (version 12) is installed and usable.
the qemuhowto states:
You must have kvm module (kvm-intel or kvm-amd) installed for your kernel, and the permission of /dev/kvm is set to allow your user to access it. Otherwise the KVM support will be disabled and it may run very slow.
here is step by step how to get KVM Installation with images
How to Start Intel Hardware-assisted Virtualization (hypervisor) on Linux to Speed-up Intel Android x86 Emulator
The Intel Hardware Accelerated Execution Manager provides hardware-assisted virtualization. It should (hopefully) work the same with more recent versions of the Android emulator. Use the Android SDK Manager to download the KitKat x86 emulator.
Here's a more recent Intel document: http://software.intel.com/en-us/android/articles/speeding-up-the-android-emulator-on-intel-architecture
and Google's documentation: http://developer.android.com/tools/devices/emulator.html
Do follow those instructions.
If it still doesn't work for you, there are many possible causes such as: not having an Intel CPU, not installed properly, need to set BIOS settings, need to reboot, need to allocate lots of memory to HAXM, need to keep the AVD memory size down, attempting to configure the emulator to use the host GPU, ...
What are the specific symptoms? Do try searching for them on Google.
Also search for Hardware Accelerated Execution Manager linux for more documentation and experience reports.

Running the new Intel emulator for Android

Lately Google and Intel have published a new way to run the emulator, which should work much better than the previous version (which has emulated ARM CPU). Here are some links about it: this and this.
However, after installing the new components and creating a new emulator configuration as instructed, I get an error and I also can't see any improvements. I've tried both API 10 and API 15, and with GPU enabled and disabled. None of those configurations helped. I've also tried it on two different computers and didn't get any boost (and got the same errors).
It seems that on the posts I've read about it, nobody had any problems with it and all report a much faster emulator.
The error it shows is:
emulator: Failed to open the HAX device!
HAX is not working and emulator runs in emulation mode
emulator: Open HAX device failed
Why is it happening, and is there a way to fix it? Is there anyone else who gets those errors or vice versa?
By the way, I have an Intel CPU, if that could be a problem.
EDIT:
here's what I see in the BIOS, so it should be available... :
I had the same issue, solved it by Installing the Intel Hardware Accelerated Execution Manager. Download it with the SDK Manager, it's in Extras. After this, go to the folder
[Android SDK Root]\extras\intel\Hardware_Accelerated_Execution_Manager
then run IntelHaxm.exe and install.
Here the link of the Intel Hardware Accelerated
IntelHaxm.exe for
Microsoft Windows,Mac OS* X, and Linux
Ubuntu
You'll get the following message if you don't have virtualization enabled in your BIOS:
Small Note for Windows 8 user, Intel HAX will not work if Hyper-V feature is enable. Hyper-V (like most of the virtualization tech) will exclusively lock the VT extension witch will prevent HAX to work properly. A workaround if you “need” Hyper-V too might be to stop manually the Hyper-V services when you need HAX (haven’t tested it yet through).
If all else fails. Simply try to download the Intel HAXM zip manually, extract and install.
check here
Remember this only works for an Intel cpu that supports Intel Virtualization Technology. And you MUST enable virtulization in your bios.
It's a fairly decent and very noticeable improvement to the android emulator if you ask me.
Not every processor is supporting the virtualization!
To find out your chipset abilities go to http://ark.intel.com/,
insert the name of your processor in the search line and check out the resolve.
Advanced Technologies: ...
Intel® Virtualization Technology (VT-x) = ???
If you see "No", you can forget HAXM!
Here are the steps to get the Hardware Accelerated Execution (HAX) which is really quite a lot:
1-check your processor Intel website to see if it supports Intel VT-x or not:
http://ark.intel.com/Products/VirtualizationTechnology
all Intel Core i processors and some other selected processors support Intel VT-x
2- check your bios to enable Intel VT-x , usually called hardware virtualization or Intel virtualization in bios
3- check if you are using a software conflicting with HAXM, popular software conflicting with haxm include but not limited to:
Hyper-V
Windows phone SDK 8
Avast antivirus 8
4-install Intel management engine interface (MEI), this driver is usually not installed and is not part of retailer Windows DVD, even Windows 8.
Check this post about how to install:
http://communities.intel.com/community/vproexpert/blog/2011/12/19/mei-driver-now-available-via-microsoft-windows-update
This driver is required and is not optional to activate Hardware Acceleration
you can also install it from windows update
5-use android SDK manager to download Extras -> Intel x86 Hardware Accelerated Execution Manager.
6-Run installer of HAXM from:
[Android SDK Root]\extras\intel\Hardware_Accelerated_Execution_Manager\IntelHaxm.exe
if you passed the previous steps the installer will work just fine ,otherwise it will fail
7-start AVD and see the difference in performance, Animations are faster
System UI and launchers crashes in 4.0.3 but are just fine for 4.2.2
see installation guide by intel:
Using SDK Manager to download Intel HAX did not work.
Downloading and installing it from the Intel website did work.
http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/
Top Tip: making the change in my BIOS to enable virtualization and then using "restart" did not enable virtualization. Doing a cold boot (i.e. shutdown and restart) suddenly made it appear.
The first step (on Windows) is to make sure that the Micrsoft Hardware-Assisted Virtualization Tool reports that "this computer is configured with hardware-assisted virtualization".
http://www.microsoft.com/en-us/download/details.aspx?id=592
You might need to turn on virtualization in your BIOS, most manufacturers disable it by default. Intel HAX requires CPU virtualization to be enabled.
The same began to happen to me about one week ago, without apparent reason (99% sure that I didn't upgrade anything); after being able to run the emulator for some time it just stopped working without an apparent reason.
I tried to install the Intel thingie, but the installer reported that my machine doesn't support Intel VM, despite the fact that it has an Intel i3 processor and that virtualization is enabled (perhaps XP is too old an OS for that, although MS VM, Oracle's Virtual Box and VMWare have been installed an working in this machine with the same OS).
I just edited the VD to emulate an Arm processor, and everything is working again.
Perhaps not the optimal solution, but it works!
For Windows, there are some answers explained how it works. But I'm a Mac User, I don't know how to install HAX driver for Mac as they did for Windows. Finally I found the below link and it did fix my problem. You should download HAXM of Mac
and then install it.
https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement-macosx/
Complete step-by-step instructions for running the accelerated emulator can be found on the official Android developers website:
Caution: As of SDK Tools Revision 17, the virtual machine acceleration
feature for the emulator is experimental; be alert for
incompatibilities and errors when using this feature.
You have to download the Intel® Hardware Accelerated Execution Manager.
Then you will get this message:
Starting emulator for AVD 'test'
emulator: device fd:740
HAX is working and emulator runs in fast virt mode
For Mac users who want to check whether your processor supports virtualisation, use the maccpuid software and look for VMX. If it is checked then you're good to go.
Download it here
Here there are two issues we have to concentrate on:
HAX device failed to open,
For this problem, you have to run the HAX device setup file from the HAX addon folder. Follow Speed Up Android Emulator to know clearly how.
If you created the AVD through AVD manager then you can change the RAM size in AVD Manager and device edit option.
If you created the AVD through command line, then you should start the AVD from command line will work,
emulator -memory 512 -avd gtv_avd
If everything else fails, it's good to try my option and download a HAXM installer.
It needs to be copied to HAXM installation folder and then started from command line (start CMD as an Administrator). After restarting computer HAXM will be installed. It perfectly worked for me as I was having problems with installing it on my laptop.
After all simply type sc query intelhaxm in your cmd in order to check whether HAXM is installed properly.
If you are running an Intel processor make sure the HAXM (Intel® Hardware Accelerated Execution Manager) installer is installed via SDK Manager by checking this option in SDK Manager. And then run the HAXM installer ext via the path below.
your_sdk_folder\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe
Also check the RAM size allocated while doing HAX installation so it fits the RAM size of your emulator.
This video shows all the required steps which may help you to solve the problem.
This video will also help you if you face a problem after installing HAXM.
Download HAXM from the Intel site.
Install it.
And then run the AVD from AndroidStudio, menu -> Tools -> AVD. Choose x86.
It works!

Categories

Resources