问题
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.
回答1:
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!
来源:https://stackoverflow.com/questions/41094934/cannot-launch-avd-in-emulator-in-android-studio-invalid-argument