15

When i run emulator, i get the following error:

Cannot launch AVD in emulator.

Output: Hax is enabled qemu-system-x86_64.exe: -drive if=none,index=1,id=cache,file={path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img: could not open disk image {path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img:

Could not open '{path_to_SDK}\SDK.android\avd{AVD_name}.avd/cache.img':

Invalid argument

Hax ram_size 0x40000000

HAX is working and emulator runs in fast virt mode. Error accepting connection, aborting

AVD specs are:

OS: Android 6.0 Google APIs

RAM: 1GB

Resolution: 1440x2560

Running on Android Studio 2.0 Beta 6, Windows 10.

Malwinder Singh
  • 6,644
  • 14
  • 65
  • 103

4 Answers4

33

Keep an eye out for a background qemu-system-i386.exe process running in the background that will be locking the cache.img file.

Windows Task Manager - Background Emulator Process

This might be still running from a previously failed emulator launch. Kill that using Task Manager and start again.

Umair M
  • 10,298
  • 6
  • 42
  • 74
Dave Tyler
  • 595
  • 5
  • 7
  • Had this issue in Visual Studio and killing this task (no emulators showed to be running) and restarting debug took care of the error. – Robb Sadler Dec 13 '16 at 22:42
  • 1
    When you look at the answers / comments for questios like this... a native .net developer wonders if they can ever reliably count on microshaft. – Kulingar Jan 08 '17 at 21:44
4

I had the same problem already twice since I upgraded to Android Studio 2.0 on Windows 10. I use a preferred emulator in the Run/Debug configuration. Changing the Deployment Target Options in the configuration to Target: Show Device Chooser Dialog solved it for me. After choosing the same emulator instance in the dialog it started with no problem. Then I change back to the preferred emulator setting. Until the next time it breaks...

Hoping this helps.

sw-dev
  • 73
  • 7
2

I faced the same problem in Windows 10.

Clearing temp and %temp% folder followed by a restart of machine solved my problem.

halfer
  • 19,824
  • 17
  • 99
  • 186
pallav bohara
  • 6,199
  • 6
  • 24
  • 45
0

I had this problem, when I didn't notice that emulator is already running :)

Michal Dobrodenka
  • 1,104
  • 8
  • 27