2

I've created two emulators in AVD, one phone and one tablet and both are using the same x86 image (Jelly Bean, API 16). Both emulators are using 768 Mb RAM and the limit for HAXM is 2 Gb.

Running each emulator separately is working fine, however running them simultaneously causes an error if one emulator is already running and I'm trying to run the second one :

enter image description here

Cannot launch AVD in emulator... Could not open system.img: Invalid argument

What could be the reason for this behaviour and how may I fix this?

Edit: I can run both emulators simultaneously when using different system images (e.g. using API 16 and 17 works, but using API 16 twice does not).

baris1892
  • 981
  • 1
  • 16
  • 29
  • check this link (http://stackoverflow.com/questions/35701174/could-not-open-avd-name-avd-cache-img) – Kuldeep Kulkarni Oct 04 '16 at 09:53
  • probably the Intel Haxm.. is that enable from boot? @radon66? – O_o Oct 04 '16 at 10:14
  • @Kuldeep Kulkarni: Does not help...I can't even start two emulators with the same image, so my problem was not to deploy my app on this emulated devices. – baris1892 Oct 04 '16 at 11:51
  • @ibtehaz: As I already said, starting only one emulator works fine, therefore HAXM is enabled in BIOS. Only two emulators does not work. – baris1892 Oct 04 '16 at 11:51

1 Answers1

3

Recent Emulator versions have the following piece of code:

if (!opts->no_snapshot_load || !opts->no_snapshot_save) {
    android_op_writable_system = true;
}

This forces the emulator to open system.img for writing, even if it doesn't need to write into it. Windows doesn't allow to open a file multiple times for writing (unless you add specific flags to the call, and emulator doesn't). So the reason why emulator fails to start for the second time is that on Windows it has a bug: https://code.google.com/p/android/issues/detail?id=224402

MT-Wizard
  • 158
  • 5