6

I cannot properly start an emulator on my Mac Mini. When I execute the emulator command, the emulator window appears, the boot animation starts, but after a while I get this error messages:

ERROR: detected a hanging thread 'QEMU2 CPU0 thread'. No response for 15011 ms

And the emulator either quits or becomes completely unresponsive.

The Mac Mini is of late 2012, has 16GB RAM, a 2.5 GHz Intel Core i5 CPU with an HD 4000 graphics card; Not the fastest, but should be able to run the emulator (and has been able to do that without problems in the past)

I tried:

Updating the emulator:

emulator -version
Android emulator version 28.0.25.0 (build_id 5395263) (CL:77b96786ddf712e1477c6e05cddb09526043faef)

Verify Intel Haxm is installed:

 kextstat | grep intel
  102    0 0xffffff7f83833000 0x28000    0x28000    com.intel.kext.intelhaxm (7.3.2) 58DFBE80-E54A-3EFE-B38A-215C5ED8E828 <7 5 4 3 1>

Running the emulator without audio and window:

emulator -no-audio -no-window  -no-boot-anim @avd

(same results)

Lowering the resolution of the avd:

hw.lcd.density = 240
hw.lcd.height = 960
hw.lcd.width = 540

in config.ini of the avd

Disabling/Enabling IPv6 doesnt change anything.

Full config.ini:

PlayStore.enabled = false
abi.type = x86
avd.ini.encoding = UTF-8
hw.accelerometer = yes
hw.audioInput = yes
hw.battery = yes
hw.cpu.arch = x86
hw.dPad = no
hw.device.hash2 = MD5:1c925b9117dd9f33c5128dac289a0d68
hw.device.manufacturer = Google
hw.device.name = Nexus 5
hw.gps = yes
hw.lcd.density = 240
hw.lcd.height = 960
hw.lcd.width = 540
hw.mainKeys = no
hw.sdCard = no
hw.sensors.orientation = yes
hw.sensors.proximity = yes
hw.trackBall = no
image.sysdir.1 = system-images/android-28/google_apis/x86/
tag.display = Google APIs
tag.id = google_apis
hw.gpu.mode = host
hw.gpu.enabled = yes
skin.dynamic = yes
hw.ramSize = 2048

Full output of the emulator command:

 emulator @avd
2019-04-05 14:42:46.888 qemu-system-x86_64[72065:9498885] GetInputSourceEnabledPrefs user file path = /Users/dgns/Library/Preferences/com.apple.HIToolbox.plist
2019-04-05 14:42:46.888 qemu-system-x86_64[72065:9498885] GetInputSourceEnabledPrefs effective user id path = 501
2019-04-05 14:42:46.888 qemu-system-x86_64[72065:9498885] GetInputSourceEnabledPrefs user pref content = <CFBasicHash 0x7fa6a164d730 [0x7fffaa5028e0]>{type = immutable dict, count = 1,
entries =>
    0 : <CFString 0x7fa6a1616070 [0x7fffaa5028e0]>{contents = "AppleSavedCurrentInputSource"} = <CFBasicHash 0x7fa6a164d6f0 [0x7fffaa5028e0]>{type = immutable dict, count = 3,
entries =>
    0 : <CFString 0x7fffaa570f68 [0x7fffaa5028e0]>{contents = "InputSourceKind"} = <CFString 0x7fffaa5b64a8 [0x7fffaa5028e0]>{contents = "Keyboard Layout"}
    1 : <CFString 0x7fffaa56bc68 [0x7fffaa5028e0]>{contents = "KeyboardLayout Name"} = Austrian
    2 : <CFString 0x7fffaa5a25e8 [0x7fffaa5028e0]>{contents = "KeyboardLayout ID"} = <CFNumber 0x5c37 [0x7fffaa5028e0]>{value = +92, type = kCFNumberSInt64Type}
}

}
emulator: INFO: boot completed
emulator: ERROR: detected a hanging thread 'QEMU2 CPU0 thread'. No response for 15011 ms
emulator: ERROR: detected a hanging thread 'QEMU2 CPU1 thread'. No response for 15011 ms
emulator: ERROR: detected a hanging thread 'QEMU2 CPU0 thread'. No response for 15011 ms
which emulator
/Users/<user>/Library/Android/sdk/emulator/emulator

Expected Result: Emulator Boots and is able to run the automated tests afterwards

Actual Result: Emulator quits or hangs

knaecke
  • 190
  • 1
  • 1
  • 12
  • 1
    Run `emulator-check accel hyper-v cpu-info window-mgr desktop-env` to check if emulator binary sees haxm acceleration – Sergii Pechenizkyi Apr 08 '19 at 13:37
  • 2
    have you seen this link?https://stackoverflow.com/questions/47956847/android-studio-emulator-error-detected-a-hanging-thread-qemu2-main-loop – keepTrackOfYourStack Apr 09 '19 at 14:41
  • looks ok: accel: 0 HAXM version 7.3.2 (4) is installed and usable. accel hyper-v: 0 Hyper-V runs only on Windows hyper-v cpu-info: 146 Intel CPU|Virtualization is supported|64-bit CPU| cpu-info window-mgr: 0 Mac window-mgr desktop-env: 0 Mac desktop-env – knaecke Apr 10 '19 at 08:58
  • Yes, I tried turning on IPv6, or disabling it, did not change anything unfortunately. The problem also persists with Quick Boot – knaecke Apr 10 '19 at 13:10

2 Answers2

1

I had the same issue on a Mac Mini. This is what worked for me:

Go to Tools->AVD Manager->Edit(The particular emulator)>Show Advanced Settings

Then in the Emulated Performance section, I changed it from Quick Boot to Cold Boot.

Other options if this doesn't work can be found here.

Ben
  • 3,346
  • 6
  • 32
  • 51
0

I have gone to Tools->AVD Manager->Edit(The particular emulator)>Show Advanced Settings

Then in the Emulated Performance section i had the Quick Boot selected, which i changed to Cold Boot and everything started working fine.

Softlabsindia
  • 791
  • 6
  • 11