31

Until the last SDK release, my Android Emulator worked very nice with x86 architecture, installing Intel HAXM and enabling GPU for the device in AVD Manager.

With the latest SDK release, I reinstalled my Windows (from 8.0 to 8.1), tried both 1.06 and 1.07 Intel HAXM and my app freezes quite frequently.

It doesn't freeze to death, just the freezes/does not updates the screen anymore.

Especially if I'm swiping a ViewPager, then it freezes almost always in between pages.

BUT, if I click a menuitem on the AppBar, it refreshes itself and draws the destination ViewPage page.

I'd appreciate any advice, because right now app development via emulator became ultrapainful.

Edward Brey
  • 40,302
  • 20
  • 199
  • 253
Csabi
  • 807
  • 3
  • 8
  • 18

11 Answers11

47

My emulator froze and I couldn't fix it with the other answers, but this solved it:

  1. Tools->Device Manager

  2. In the Actions column for your virtual device, click the three dots on the right and then click Wipe Data.

This will clear the cache for the virtual device.

If your app depends on Google Play services, you will need to update it again

Fix for "The selected AVD is currently running in the Emulator"

Elijah
  • 1,814
  • 21
  • 27
Gimme the 411
  • 994
  • 9
  • 25
16

Try this:

In the Android Virtual Device (AVD) settings, select
- edit this AVD, then click
- show advanced setting then
- DISABLE multi-core CPU.

SherylHohman
  • 16,580
  • 17
  • 88
  • 94
Aasim Ali
  • 161
  • 1
  • 4
  • 1
    Do you have any reference, or can you explain why Disabling multi-core CPU might help ? – SherylHohman Apr 14 '18 at 21:13
  • This seems to have worked for me. The error I was getting logged out before the emulator freezes up is: "Emulator: qemu-system-i386.exe: WHPX: Failed to set interrupt state registers, hr=c0350015". The closest I can find about what that MAY be is https://stackoverflow.com/questions/23507006/x86-pic-is-it-correct-for-qemu-to-raise-interrupts-on-all-cpus which, if this is the problem, would be why single core works, maybe! – deive Jul 18 '18 at 12:56
  • Helped me. Thank you, stranger! – Vassily Jun 03 '21 at 18:07
  • 1
    Apparently this option is not available in emulators since API 31 – Gabriel Vasconcelos Aug 10 '21 at 14:40
  • Worked for me api level 34 tab emulator – AskQ Jul 29 '23 at 09:21
8

In the Android Virtual Device (AVD) settings, turn off the Use Host GPU emulation option. Unfortunately, the resulting slowness is often worse than the freezing.

Edward Brey
  • 40,302
  • 20
  • 199
  • 253
5

Before doing the steps you need to delete the .lock folder under the C:\Users\user\.android\avd\yourEmulatorName\ path, To go there just simply click Show on Desk .Then -

Step 1: Go to AVD Manager and click the drop-down and select Stop. The emulator will be stopped then.

enter image description here

Step 2: Then click the Cold Boot Now

Gk Mohammad Emon
  • 6,084
  • 3
  • 42
  • 42
2

Use the free Visual Studio Emulator for Android. It's very fast, and despite its name, does not require you to work in Visual Studio to use it. Android Studio and Eclipse happily detect it as the running emulator.

Edward Brey
  • 40,302
  • 20
  • 199
  • 253
2

Setting Boot option to Cold boot worked like a charm for me. Absolutely no idea why.

Also disabling advanced profiling helped me with older versions (API 21).

enter image description here

David Vareka
  • 252
  • 2
  • 6
0

What helped me was to use a lower version of SDK in emulator, namely the SDK version 31 (image "S") Please note the date I'm writing this, if you are seeing this in the future try lowering your version acccordingly

0

stop the emulator and go to C:\Users\YOUR_USER\.android\avd\Pixel_6_Pro_Edited_API_33.avd and delete

version_num.cache

cache.img.qcow2

cache.img

multiinstance.lock

hardware-qemu.ini.lock

AVD.conf

it will work

RusArtM
  • 1,116
  • 3
  • 15
  • 22
Ahmad
  • 9
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 13 '23 at 01:29
0

Try giving virtual device less RAM.

Android froze on start with 4GB (=4096MB) RAM but did not freeze with 3GB (=3072MB).

Note: I'm using Android Studio on Linux Mint 21.1.

BZZZZ
  • 11
  • 2
-2

From the Android SDK Manager, install Intel x86 Emulator Accelerator (HAXM installer) revision 5 or later, and then run sdk\extras\intel\Hardware_Accelerated_Execution_Manager\intelhaxm.msi to update the drivers on your PC. This is version 1.1.0 of the accelerator, which seems to fix the freezing bug.

Edward Brey
  • 40,302
  • 20
  • 199
  • 253
-2

Try this :

sdk\tools\emulator.EXE -partition-size 512 -noaudio -no-boot-anim -avd Nexus5XAPI25 -prop monodroid.avdname=Nexus5XAPI25

After I added -noaudio option,it's ok

Alex Nguyen
  • 1,032
  • 12
  • 27