Android studio emulator fails to start with memory

2019-01-18 02:47发布

I'm trying to run my first android studio project but I get this error message and the emulator doesn't start :

Created filesystem with 11/4224 inodes and 1302/16896 blocks
Failed to create Context 0x3005
emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
emulator: WARNING: Requested RAM size of 1536MB is too large for your environment, and is reduced to 1152MB.
emulator: device fd:544
HAX is not working and emulator runs in emulation mode
emulator: The memory needed by this VM exceeds the driver limit.
Cannot set up guest memory 'pc.ram': Invalid argument

8条回答
放荡不羁爱自由
2楼-- · 2019-01-18 03:17

After Android Studio is installed

In CMD (Run As Admin) execute this command (Emulator should be closed):

//if it's installed on D:, at first, "cd" to that drive, like  "D:"
cd "%ANDROID_SDK_HOME%\sdk\extras\intel\Hardware_Accelerated_Execution_Manager"
silent_install.bat -m 1024

this will set HAXM memory to 1024Mb (max 1800). Set RAM parameter in VDM slightly below this value, like 980

If you are using Mac OS then use navigate to path /<USER_DIR>/Library/Android/sdk/extras/intel/Hardware_Accelerated_Execution_Manager and execute sudo ./silent_install.sh -m 1024

查看更多
贪生不怕死
3楼-- · 2019-01-18 03:17

It seems that the AVD does not like to set the memory in GB. If it does not save the new setting in GB change it to MB.

查看更多
ら.Afraid
4楼-- · 2019-01-18 03:22

In Android Studio, version 1.2.1.1:

Go to "Tools -> Android -> AVD Manager -> Chose your device -> Edit -> Advanced Settings -> Change the RAM parameter to 512 Mb.

Save it, and run the App in the Emulator. It should run now.

查看更多
\"骚年 ilove
5楼-- · 2019-01-18 03:24

In my case, this issue happened when I click run twice unintentionally from AVD manager. I resolved this issue by killing the running instance from taskmanager (qemu-system-i386.exe).

查看更多
Lonely孤独者°
6楼-- · 2019-01-18 03:24

I tried the above answers in Android Studio 3.0, but it seems AS 3.0 doesnt allow to change in the IDE screen, or not sure it was some problem with my installation. So I opened the AVD in disk and opened the config.ini, and changed the ramsize there. It worked.

查看更多
Rolldiameter
7楼-- · 2019-01-18 03:31

Try restarting your computer!

I was just wrestling with this problem and after an hour of scouring the web to no avail I tried restarting my computer and the problem was resolved.

查看更多
登录 后发表回答