HAXM configuration in android studio - android

I tried to run a simple Android chat app from GitHub. I think there's a problem with my HAXM configuration. When I run the app I see these errors:
HAXM is not working and emulator runs in emulation mode
emulator The memory needed by this AVD exceeds the max specified in your HAXM configuration.
emulator: AVD RAM size = 1536 MB
emulator: HAXM max RAM size = 768 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.
emulator: warning: opening audio output failed creating window 61 83 462 820
emulator: emulator window was out of view and was recentered
What is wrong?

Reinstall HAXM with more RAM:
sudo $ANDROID_SDK/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh -u
sudo $ANDROID_SDK/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/silent_install.sh -m 1024

your HAXM RAM is lower than your AVD RAM.
Solutions:
Re-run you HAXM installation and increase RAM to match that of AVD(emulator).
Alternatively, decrease RAM of AVD(emulator) to match that of HAXM.

The memory needed by this AVD should not be exceeds the max specified in your HAXM configuration.
It should be less than RAM set for HAMX.
Go to ~\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager \intelhamx_android.exe.
Reinstall intel HAXM and set its RAM to 1024MB.
Edit your AVD set its RAM to 768MB.
Build and run your application.
If you cant change the RAM via reinstalling it means you installed HAXM via Android Studios.
Ctrl + Alt + S
click on SDK Tools
uncheck the box for Intel HAXM (Intel HAXM Installer)
click Apply
recheck the box for Intel HAXM and the program should now ask you to reenter the RAM Usage via slider or number

Be sure when you increase your HAXM RAM configuration that your computer is able to handle this increased RAM. I use a 4GB RAM macbook pro that almost stopped responding after I increased HAXM RAM to 2GB. It may be a better option to decrease your AVD RAM.

After re-installing HAXM with more (ideally more than 1536 MB) space solves the problem.
How to install HAXM for MAC -
https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-mac-os-x
How to install HAXM for Windows -
https://software.intel.com/en-us/android/articles/installation-instructions-for-intel-hardware-accelerated-execution-manager-windows

Just go to:-
Help >> Edit Custom VM options >> (see the picture below) >> Then close the file >> Restart android studio

You have to increase the amount of RAM memory in:
Tools >> Android >> AVD manager
Select your AVD, press "Edit this AVD" and under Advanced settings set the amount of RAM to i.e. 1500Mb
That will do the trick

Related

Cannot launch AVD in emulator in android studio .Invalid argument

I have a problem with emulator in Android Studio 2.1.2.
When I try launching my AVD, I receive a message which says:
Cannot launch AVD in emulator.
Output:
Hax is enabled
The memory needed by this VM exceeds the driver limit.
Hax ram_size 0x60000000
HAX is not working and emulator runs in emulation mode.
qemu-system-i386.exe: -drive if=none,index=0,id=system,file=E:\Program Files\Android\Sdk/system-images\android-24\google_apis\x86/system.img,read-only: could not open disk image E:\Program Files\Android\Sdk/system-images\android-24\google_apis\x86/system.img: Could not open 'E:\Program Files\Android\Sdk/system-images\android-24\google_apis\x86/system.img': Invalid argument
I don't know what to do.
Please give me some help.
The way I solved it is by setting the AVD memory limit and HAXM memory to be equal in size which is 1 GB = 1024 MB. The AVD cannot have higher memory limit than the HAXM.
1. Setting the HAXM memory to be 1024 M
The only way to change the HAXM memory is by installing it again. I did it using the terminal. Locate Hardware_Accelerated_Execution_Manager in your machine. Then change directory that folder to run the installation script.
cd ~/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager
-OR-
cd ~/Library/Developer/Xamarin/android-sdk-macosx/extras/intel/Hardware_Accelerated_Execution_Manager
May need to change permissions:
sudo chmod 755 "HAXM installation"
Then:
./HAXM\ installation -m 1024
-OR-
sudo ./"HAXM installation" -m 1024
2. Setting the virtual device the same size with HAXM memory limit
This works for me. Good luck!

HAXM is not working and emulator runs in emulation mode

I'm using AVD to run my app. I can see it display the android black screen, but it display this in my Android Studio.
emulator: device fd:620
HAXM is not working and emulator runs in emulation mode
emulator: The memory needed by this AVD exceeds the max specified in your HAXM configuration.
emulator: AVD RAM size = 1536 MB
emulator: HAXM max RAM size = 512 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM configuration to run in fast virt mode.
creating window 40 81 335 557
emulator: emulator window was out of view and was recentered
you need to install haxm installer from SDK manager
for that go to TOOLS > android >sdk manager >standalone SDK manager
then install packages

Not able to run the Android Emulator

Build was successful but when I tried to run the project using AVD, it shows the following message. I'm not sure what went wrong.
Warning: No DNS servers found
emulator: device fd:608
HAXM is not working and emulator runs in emulation mode
emulator: The memory needed by this AVD exceeds the max specified in
your HAXM configuration.
emulator: AVD RAM size = 1536 MB
emulator: HAXM max RAM size = 512 MB
emulator: You might want to adjust your AVD RAM size and/or HAXM
configuration to run in fast virt mode.
creating window 43 59 329 583 emulator: UpdateChecker: skipped version
check
You need to adjust your adb ram size.
First open android studio.Then at the top icon bar you can find this icon.Click it.This will open all available virtual device you have.Select your virtual device and at the right you can find this icon .Click it.This will open a new window.At the bottom of this window you can find this .Click it.Then there will be a section like this .Then change RAM size 1536 to 512.Like this .Now click finish and run your application.
Edit:
If your target api is upper than 19 then you need to adjust your haxm installer ram size because when you run your app the avd ram size will increase to 1 GB.
So how to adjust your haxm installer ram size.Follow the step mentioned below.
If you install android studio by it's default position then you can find haxm installer in this locaiton
'C:\Users\Niyamat\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerated_Execution_Manager'
Go to this location(make sure you change userName Niyamat to your username).Click "intelhaxm-android" and run it.Then an alert dialog pop up like this click yes.Then click Next.And finally click Set manually.and remove 512 and add 1024.Something like this .Then click next then install.Wait few seconds for install.And that's it.I think now you can run your app on your virtual device.
Hope this help!
HAXM RAM size should be more than AVD.
Better decrease the RAM size of AVD by editing the emulated device or the other way increase HAXM RAM size.
HAXM RAM size should be more than AVD. Decrease the RAM size of AVD or increase HAXM RAM size.
To reduce ram of avd (Wich I recommend)
Go to your avd manager. Delete the emulator and create a new one. However for the new one make sure it's ram is less than 512 mb.

Mac HAX is not working and emulator runs in emulation mode

I have been running to the following error with Latest Android Studio.
emulator: The memory needed by this VM exceeds the driver limit. HAX
is not working and emulator runs in emulation mode
I am using Mac Pro with OS 10.1.xx
I have also executed required intel drivers and confirming the installation by running the following command in Terminal Console.
kextstat | grep intel
But I am still getting the same error.
Please help.
Amount of memory when you installed HAXM and amount of memory of your emulator device? If you set 1 gb ram when you installed HAXM and your device has 1536 for example, haxm cant works.
Try reducing the Ram of your Virtual Device to the one on HAXM and it should work!!! To do that go to Tool->andriod->Avd and then select your device and click on pen . go to Advance and locate the Ram option and reduce it from there

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.

Categories

Resources