How to fix: "HAX is not working and emulator runs in emulation mode"

247,188

Solution 1

Yes it should be fixed, HAXM isn't working. How much RAM is set for use inside your AVD configuration ?

768M is a good number for it, but most importantly this number has to be lower or equal to the memory usage you have set during the installation of HAXM. You can launch its installation again to modify it.

Solution 2

If you are on a mac you can install haxm using homebrew via cask which is a built-in extension (as of 2015) which allows installing non-open-source and desktop apps (i.e. chrome, firefox, eclipse, etc.):

brew cask install intel-haxm 

Android Studio

If you are using Android Studio then you can achieve the same result from the menu ToolsSDK Manager, and then on the SDK Tools tab, select the checkbox for Intel x86 Emulator Accelerator (HAXM installer), and click Ok.

Solution 3

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

enter image description here

This works for me. Good luck!

Solution 4

install the latest HAXM from intel: https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager

After this it's working

Solution 5

For Windows.

In Android Studio:

Tools > Android > AVD Manager > Your Device > Pencil Icon> Show Advanced Settings > Memory and Storage > RAM > Set RAM to your preferred size.

In Control Panel:

Programs and Features > Intel Hardware Accelerated Execution Manager > Change > Set manually > Set RAM to your preferred size.

It is better for RAM sizes set in both places to be the same.

Share:
247,188
GnrlBzik
Author by

GnrlBzik

short to none

Updated on November 23, 2020

Comments

  • GnrlBzik
    GnrlBzik over 3 years

    Question is

    I get "HAX is not working and emulator runs in emulation mode", is this related to Intel x86 Emulator Accelerator (HAXM) installation and running avd with cpu set to CPU Intel Atom (x86)? And even though it feels like AVD runs faster after i installed HAXM, does this message indicates that AVD performance is hindered. Should it be fixed and if so, how?

    I am running on mac os x 10.9.1.

    Listing what is installed on my system via android sdk manager:

    • Tools
      • Android SDK Tools Rev 22.3
      • Android SDK Platform-tools rev 19.0.1
      • Android SDK Build-tools Rev 19.0.1
      • Android SDK Build-tools Rev 19

    ==

    • Android 4.4.2 (API 19)
      • SDK Platform
      • ARM EABI v7a System Image
      • Intel x86 Ato System Image
      • Google APIs
      • Sources for Android SDK

    ==

    • Extras
      • Intel x86 Emulator Accelerator (HAXM) AND I ALSO run dmg installer as well, and installed hot fix, after i found out about it.

    AVD set up

    • Platform 4.4.2
    • API Level 19
    • CPU Intel Atom (x86)

    Once i run avd:

    (ruby-2.0.0-p353) .android   $ tools/emulator -avd 1AVD -wipe-data -no-boot-anim -cpu-delay 0
    

    i get following and emulator eventually loads

    emulator: The memory needed by this VM exceeds the driver limit.
    
    HAX is not working and emulator runs in emulation mode
    
  • GnrlBzik
    GnrlBzik over 10 years
    About 1024 i think, so let me try setting avd to 768
  • GnrlBzik
    GnrlBzik over 10 years
    thank you @ph0b, thats it, HAXM was installed with 1024 allocation for memory and my avd instance had memory allocation set to 1907. thank you for pointing this out.
  • aalaap
    aalaap over 9 years
    The HAXM installer suggested a 1GB default, but the Nexus 5 AVD is set to use 1536. Set it back to 1GB and we're on!
  • Koh
    Koh over 9 years
    Thanks. For those who were wondering, the location of the installer file of HAXM is located in the sdk/extras/intel folder of your ADT bundle. Placing your cursor on the HAXM entry in your AVD Manager will reveal the exact location.
  • TuGordoBello
    TuGordoBello over 9 years
    how configurate that?
  • ThomasW
    ThomasW over 9 years
    @zhelon apparently the only way to configurate HAXM is to run the installer again.
  • Neurotransmitter
    Neurotransmitter over 9 years
    If you are using Windows and Android Studio, do the following. In Android Studio: Tools > Android > AVD Manager > Your Device > Show Advanced Settings > Set RAM to preferred size. In Control Panel > Programs and Features > Intel Hardware Accelerated Execution Manager > Change > Set manually > Set to preferred size.
  • Tim
    Tim over 9 years
    I only got this error when I was trying to start a 2nd AVD. Starting the first AVD gave a HAX is working and emulator runs in fast virt mode message while starting the second gave the exact same error as OP
  • Sydwell
    Sydwell about 9 years
    I had to to re-install this app and set the memory to 768mb.
  • Zabs
    Zabs about 9 years
    How do I setup memory allocation to my AVD - note I am using the latest version of Android Studio (currently 1.2)
  • Andreas
    Andreas about 9 years
    Tried to configure AVD RAM several times but it never stuck. Turned out there were several AVD Manager windows open that interfered with each other.
  • Pacerier
    Pacerier about 9 years
    @ThomasW, Do you mean run the Intel HAXM installer again to configure the settings or do we actually have to reinstall the whole thing?
  • ThomasW
    ThomasW about 9 years
    @Pacerier It's been 2 years since I did this, but if I recall correctly you need to reinstall. Perhaps the Intel installer has changed since then.
  • stephenspann
    stephenspann almost 9 years
    This worked for me as well. If you're looking for the AVD configuration screen, it's at Tools > Android > AVD Manager
  • Josh
    Josh over 8 years
    I reinstalled HAXM and set the memory setting to 2Gb, problem solved.
  • Jason Hartley
    Jason Hartley over 8 years
    If you want to have more than one AVD running at the same time, the HAXM max RAM needs to be the total for all running AVDs, i.e. two AVDs @1024MB = 2048MB, so: $ sudo ./HAXM\ installation -m 2048
  • MikeKulls
    MikeKulls over 8 years
    +1 for explaining the exact place to set these values. Too many answers on the internet assume a level of knowledge which the reader, like me, doesn't always have :-)
  • mtotschnig
    mtotschnig over 8 years
    On a Mac, if you want to increase HAXM memory to 3G you can do from a Terminal: cd Library/Android/sdk/extras/intel/Hardware_Accelerated_Execut‌​ion_Manager; sudo ./silent_install.sh -m 3072
  • GnrlBzik
    GnrlBzik about 8 years
    is this an answer? @zeeawan
  • zeeawan
    zeeawan about 8 years
    Yes, HAXM memory 1024 MB = AVD memory 1024 MB combination makes the hax started working. Plus, this answer addresses how the emulator started working for me on OS X.
  • GnrlBzik
    GnrlBzik about 8 years
    Need more narrative I think.
  • Sam
    Sam about 8 years
    So are you saying you fixed the error but you still have the issues with the emulator taking ages to boot?
  • zeeawan
    zeeawan about 8 years
    It was fine with KitKat (19) x86.
  • kip2
    kip2 almost 8 years
    The keystroke sequence above didn't work for me but just looked for the IntelHAXM_<version name>.dmg file in the 'sdk/extras/intel' dir and ran the installer from there (Mac OSX)
  • Esam Sherif
    Esam Sherif over 6 years
    Note: Running multiple AVD might be accumulated, ex: if HAXM is set to 1024M and you need to run two AVDs with 768M each. you will get the same error message for the second AVD OR: the AVD manager might lower the second AVD memory on its own if possible.