Emulator, android studio - android-studio

When I try run app in Android Studio I get warning:
Emulator: warning: host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
Does anyone know how to fix it?
I'm working on Linux Mint.

I played with (a pristine chroot of) Ubuntu 16.04 myself now. Without package grub-pc-bin installed, QEMU failed to boot the rescue image saying Could not read from CDROM (code 0004). After sudo apt-get install grub-pc-bin it booted fine. So I enforce use of platform i386-pc in the code now and produce an error if it's found missing.
I consider this ticket fixed. If you still run into issues, please make new tickets (with terminal output, Ubuntu version, and a screenshot of te QEMU window). Thanks!
more...

You can fix this by replacing your CPU to any, that support LZCNT feature. More detailed answer I posted here: Android Virtual Device ERROR on Android Studio

Related

Can't install Intel HAXM. Tried everything I can

So, I am trying to work on Android Studio. But I can't install Intel HAXM.
I am running Windows 7 and latest android studio
I tried installing from SDK. It installs perfectly but, then "HAXM device not found".
I tried installing different versions of HAXM manually. But everytime these errors pop up, when I do it manually. The errors:
error1
error2
error3
error4
error5
Things I've tried includes:
Enabling Vt-X in advanced BIOS options
Disabling Hyper-V
Installing update of windows suggested in another thread. Windows6.1-KB3033929-x64.
Tried Driver Signature Enforcement Overrider
I can't even remember anymore.
Please Help
What type is your processor? The problem with HAXM is what can installed if you have a processor is not Intel. for this reason some peaple use a emulators like bluestacks o something similar. Good Day!

Android Studio HAXM update issues

Android Studio 2.1.3
I can't seem to update HAXM. Every time I open the AVD, it gives me the following error message:
Virtual machine acceleration driver out-of-date
It then gives me a button to "Reinstall Haxm". Clicking that leads to an installation screen where I can choose the RAM allocation, where I hit Next and it starts installing. I then see it start installing and an extracting dialog flash up and disappear immediately:
It then finishes and says it was updated successfully, but then I hit Finish and it wants me to update again.
I've ensured Hyper-V isn't enabled and that virtualization is enabled in the BIOS. I've also tried installing it manually, and that looks like it all works successfully. And yet, no change in behavior by Android Studio. I have also seen this solution and tried it, with no success.
I can run the ARM EABI v7a emulators; just not the x86 ones. The ARM ones are so slow they're almost unusable, so I'd really like to find a way to fix this!
This machine does have VMWare vSphere installed on it, which is used on a regular basis. Could that be why this is happening?
First a warning. If you have a really old version of HAXM installed, follow their instructions to uninstall the old version before installing the new one.
Before installing latest HAXM, the previous versions from 1.1.4 and
below must be uninstalled using:
sudo /System/Library/Extensions/intelhaxm.kext/Contents/Resources/uninstall.sh
The Intel HAXM installation instructions are confusing and outdated, but this part is correct:
once you have installed the package, the status will appear as
‘Installed’, which is misleading as this is not the case. The SDK
only copies the Intel HAXM executable on your machine, and it is up to
you to install the executable.
I'm using Android Studio 3.0.1 on a Mac (10.11 El Capitan) and have not seem a "Reinstall HAXM" button like you described, but when an emulator is launched I do see this in the Event Log:
Emulator: WARNING: HAXM 6.0.5 is installed. Please install HAXM >= 6.2.1 to fix compatibility issues on Mac.
In SDK Manager -> SDK Tools it says the Intel X86 Emulator Accelerator (HAXM installer) is version 6.2.1. I have updated it via the SDK Manager from previous versions several times in the past but didn't realize the update was not complete.
Solution on Windows: Find the IntelHAXM.exe file and run it.
It might be at C:\Program Files\Android\android-sdk\extras\Intel\Hardware_Accelerated_Execution_Manager\IntelHaxm.exe
Solution on Mac: Find the .dmg file, open it, and double-click on the .mpkg file inside to start the actual installation. It will say the software is already installed. Press OK -> Continue -> Install to "re-install" it (meaning actually to install the newer version).
In my case the .dmg file was found at Users/{username}/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/IntelHAXM_6.2.1.dmg

Hardware Acceleration issue with emulator on Android Studio

I installed Android Studio and fired up the default emulator (Nexus 5 API 23), but got the following error message:
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.5 < 6.0.1).
It seems that a lot of people already encountered this issue and the solution would be to install Intel x86 Emulator Accelerator, but in my case, it is already installed.
Another thing I read is:
After you download it and make sure you run the setup located in: {SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.exe
I'm on a 2015 retina Macbook though, so this is not an option.
Also when creating a new Virtual Device, the error message remains the same.
What can I do to get a working emulator?
Thanks in advance!
You should mount and run the IntelHAXM_1.1.4.dmg file located in {SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager
Actually problem is that HAXM is downloaded but not installed.
So you should run executable file and install new version of HAXM.
HAXM path: {SDK_FOLDER}\extras\intel\Hardware_Accelerated_Execution_Manager

HAX kernel module is not installed - AMD processor

I've recently installed Android Studio and I'm trying to run a Hello World app to see that everything works as it should. Which it evidently doesn't. I've followed every step on the Android Developer site for setting up Android Studio, yet I get this error when I try to run my app:
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 searched for a bit and realized that HAXM is for Intel processors, and I'm running an AMD processor. I tried installing the emulator Bluestacks as suggested in this thread but it didn't help at all. Has anyone got a clever solution to this problem?
You might as well uninstall HAXM, only works with Intel processors.
A lot of answers in this forum have pointed to using genymotion (https://www.genymotion.com/) with AMD processors
This is what you need to do to fix this issue:
1) Navigate to the following path:
C:\Users\Main\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager
2) Run intelhaxm-android.exe as an administrator.
3) Once the installation is complete, Run your project and you will be able to run android emulator on your machine.
Hope this helps.

Android Studio KVM Setting?

Put in KVM (Kernel-based Virtual Machine) into my 64 bit Ubuntu 14.04 LTS per:
https://help.ubuntu.com/community/KVM/Installation
In the terminal:
kvm-ok INFO: /dev/kvm exists KVM acceleration can be used
OK so the KVM is in.
When I run the Android Emulator there is no change from the way the Emulator ran before I put in the KVM.
I've looked in to the various settings within Android Studio, and I found nothing obvious about KVM.
Does Android Studio have a setting somewhere to enable KVM?
Android Studio 1.5 and 2.0 do not have such option any more.
Update: that is because the team has made KVM mandatory. And see comments from Google employees claiming that their new 2.0 emulator is also KVM-based.
Alright, so when you see the message (on Android Studio v2 and higher):
KVM is required to run this AVD.
/dev/kvm device: permission denied
Grant current user access to dev/kvm
What you can do (manually, since I haven't found anything in Android Studio) to fix this is:
Add your Linux user into the kvm group: sudo adduser your_linux_user kvm
If the group doesn't exist, download this package sudo apt install qemu-kvm and try to add your user again into the kvm group.
When the user has successfully been added into the KVM group, logout or restart and try opening Android Studio again.
This setting works totally fine in Ubuntu 18.04/18.10, but it should work in other distros as well.
You can do this:
Click on Run -> Edit Configurations and go to the Emulator tab
You can add it on "additional commandline options":
-qemu -enable-kvm
I'm not sure if there is also a GUI option somewhere though, or how to check if it is working or not.
I'd test the x86 image to see if it works any faster.
Downgrade to Android Studio 1.4 (delete Android Studio 1.5 installation, download zip from http://tools.android.com/download/studio/builds/1-4-0, follow installation instructions).
Follow Stuart Axon's instructions above.
Gabor as far as I can tell is correct (and addresses the OP's question) - the option to use this acceleration by starting the emulator from within Android Studio 1.5 has been removed.
(Weirdly, I don't seem to be able access the acceleration when starting the emulator from the command line once Android Studio 1.5 has been installed - but maybe I'm wrong.)

Resources