Android Studio模拟器:ERROR:检测到挂起线程QEMU2主循环

时间:2017-12-23 23:22:24

标签: android-emulator qemu

我在Ubuntu 16.04上使用Android Studio 3.0.1。

昨天,Android Studio弹出一条消息,说有可用的更新,我总是点击这些。然后它通知我它已成功更新模拟器。

我的AVD之前运行得很好,但是在更新完成后,现在当我启动它时,它在模拟器窗口中显示黑屏15秒,然后崩溃并显示以下错误消息:

ERROR: detected a hanging thread 'QEMU2 main loop'. No response for 15000 ms
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

我尝试了描述类似模拟器问题的所有线程中建议的解决方案。 (我验证了模拟器仍然通过SDK Manager安装,我尝试在AVD的软件和硬件图形设置之间切换,我尝试用更新的版本6.0.24替换libstdc ++,我试着改为ln -sf我的/ usr / lib .. libstdc ++ 6.0.21进入SDK模拟器lib64 / libstdc ++文件夹,我甚至下载了Android Studio,并使用自己的新SDK文件夹和新下载的SDK运行全新安装,我尝试创建具有不同架构的新AVD(arm)和不同的API级别(24,27),我尝试重新启动ADB,甚至重新启动计算机。没有任何帮助。

我的SDK工具菜单没有模拟器加速器(HAXM)的条目,虽然我的电脑有一个Intel CPU:我不应该改变这个,因为我的AVD工作在昨天!什么破了?

导致QEMU2主循环的原因是什么?挂起,我该如何解决?

11 个答案:

答案 0 :(得分:10)

我找到了一个临时解决方法 - 确保启用了IPv6。

$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
0

如果您在上面看到1,请编辑 /etc/sysctl.conf 文件并注释掉所有IPv6禁用指令:

# net.ipv6.conf.all.disable_ipv6 = 1
# net.ipv6.conf.default.disable_ipv6 = 1
# net.ipv6.conf.lo.disable_ipv6 = 1

更新1月5日,'18:至少有一个用户报告禁用以前启用的IPv6已解决了他的系统上的问题。在这种情况下,如果系统上已启用IPv6且模拟器未启动,您可能需要尝试撤消上述步骤。

在Ubuntu 16.04上最新更新Android SDK后,我开始遇到完全相同的问题。可执行文件没有符号,所以我不确定如何将原始开发人员指向根本原因,但这里是线程状态:

(gdb) info threads
  Id   Target Id         Frame 
  1    Thread 0x7f6d20428700 (LWP 14472) 0x00000000014e8baf in ?? ()
  2    Thread 0x7f6d20c29700 (LWP 14471) syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
* 3    Thread 0x7f6d20c2ad00 (LWP 14470) 0x00007f6d258a27d1 in __GI_ppoll (fds=0x3842bf8, nfds=1, timeout=<optimized out>, sigmask=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:50
  4    Thread 0x7f6d1d427700 (LWP 14479) pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  5    Thread 0x7f6d1649b700 (LWP 14483) pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  6    Thread 0x7f6d05fe4700 (LWP 14487) __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
  7    Thread 0x7f6d16c9c700 (LWP 14482) __lll_lock_wait () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:135
  8    Thread 0x7f6d1cc26700 (LWP 14480) pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  9    Thread 0x7f6d1eda9700 (LWP 14478) 0x00007f6d258a270d in poll () at ../sysdeps/unix/syscall-template.S:84
  10   Thread 0x7f6d067e5700 (LWP 14486) 0x00007f6d280107cd in connect () at ../sysdeps/unix/syscall-template.S:84
  11   Thread 0x7f6d15c9a700 (LWP 14484) 0x00007f6d258a27d1 in __GI_ppoll (fds=0x7f6d10000aa0, nfds=5, timeout=<optimized out>, sigmask=0x0)
    at ../sysdeps/unix/sysv/linux/ppoll.c:50
  12   Thread 0x7f6cff7fe700 (LWP 14489) pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  13   Thread 0x7f6cfffff700 (LWP 14488) 0x00007f6d258a270d in poll () at ../sysdeps/unix/syscall-template.S:84
  14   Thread 0x7f6cfeffd700 (LWP 14490) pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  15   Thread 0x7f6cfe7fc700 (LWP 14492) 0x00007f6d280107cd in connect () at ../sysdeps/unix/syscall-template.S:84
  16   Thread 0x7f6cfdffb700 (LWP 14493) 0x00007f6d258a27d1 in __GI_ppoll (fds=0x7f6c78012818, nfds=3, timeout=<optimized out>, sigmask=0x0)
    at ../sysdeps/unix/sysv/linux/ppoll.c:50
  17   Thread 0x7f6c93dfe700 (LWP 14498) pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185

enter image description here

日志输出:

emulator:Android emulator version 26.0.3.0 (build_id 3965150)
emulator:Found AVD name 'Nexus_5X_API_25'
emulator:Found AVD target architecture: x86_64
emulator:argv[0]: './emulator'; program directory: '/home/sl/opt/android-sdk/tools'
emulator:  Found directory: /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64/

emulator:Probing for /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu: file exists
emulator:Auto-config: -engine qemu2 (based on configuration)
emulator:  Found directory: /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64/

emulator:try dir /home/sl/opt/android-sdk/tools
emulator:try dir ./
emulator:try dir ../emulator
emulator:Found target-specific 64-bit emulator binary: /home/sl/opt/android-sdk/tools/../emulator/qemu/linux-x86_64/qemu-system-x86_64
emulator:Adding library search path: '../emulator/lib64'
emulator:Adding library search path: '../emulator/lib64/gles_swiftshader'
emulator:Adding library search path: '../emulator/lib64/gles_angle'
emulator:Adding library search path: '../emulator/lib64/gles_angle9'
emulator:Adding library search path: '../emulator/lib64/gles_angle11'
emulator:Adding library search path: '../emulator/lib64/libstdc++'
emulator: Adding library search path for Qt: '../emulator/lib64/qt/lib'
emulator: Setting Qt plugin search path: QT_QPA_PLATFORM_PLUGIN_PATH=../emulator/lib64/qt/plugins
emulator: Running :/home/sl/opt/android-sdk/tools/../emulator/qemu/linux-x86_64/qemu-system-x86_64
emulator: qemu backend: argv[00] = "/home/sl/opt/android-sdk/tools/../emulator/qemu/linux-x86_64/qemu-system-x86_64"
emulator: qemu backend: argv[01] = "-avd"
emulator: qemu backend: argv[02] = "Nexus_5X_API_25"
emulator: qemu backend: argv[03] = "-verbose"
emulator: Concatenated backend parameters:
 /home/sl/opt/android-sdk/tools/../emulator/qemu/linux-x86_64/qemu-system-x86_64 -avd Nexus_5X_API_25 -verbose
emulator: Android virtual device file at: /home/sl/.android/avd/Nexus_5X_API_25.ini
emulator: virtual device content at /home/sl/.android/avd/Nexus_5X_API_25.avd
emulator: virtual device config file: /home/sl/.android/avd/Nexus_5X_API_25.avd/config.ini
emulator: using core hw config path: /home/sl/.android/avd/Nexus_5X_API_25.avd/hardware-qemu.ini
emulator: using snapshot lock path: /home/sl/.android/avd/Nexus_5X_API_25.avd/snapshot.lock
emulator: Found AVD target API level: 25
emulator: Read property file at /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//build.prop
emulator: No boot.prop property file found.
emulator: Warning: config.ini contains invalid skin.path entry: _no_skin
emulator: autoconfig: -skin 1080x1920
emulator: autoconfig: -skindir (null)
emulator: autoconfig: -kernel /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu
emulator: Target arch = 'x86_64'
emulator: Auto-detect: Kernel image requires new device naming scheme.
emulator: Auto-detect: Kernel does not support YAFFS2 partitions.
emulator: autoconfig: -ramdisk /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//ramdisk.img
emulator: Using initial system image: /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//system.img
emulator: No vendor image
emulator: autoconfig: -data /home/sl/.android/avd/Nexus_5X_API_25.avd/userdata-qemu.img
emulator: autoconfig: -initdata /home/sl/.android/avd/Nexus_5X_API_25.avd/userdata.img
emulator: autoconfig: -cache /home/sl/.android/avd/Nexus_5X_API_25.avd/cache.img
emulator: Physical RAM size: 1536MB

emulator: VM heap size 256MB is below hardware specified minimum of 384MB,setting it to that value
emulator: System image is read only
emulator: Found 1 DNS servers: 127.0.1.1
emulator: found magic skin width=1080 height=1920 bpp=16

emulator: CPU Acceleration: working
emulator: CPU Acceleration status: KVM (version 12) is installed and usable.
emulator: GPU emulation enabled using 'host' mode
emulator: Initializing hardware OpenGLES emulation support
emulator: Found 1 DNS servers: 127.0.1.1
Content of hardware configuration file:
  hw.cpu.arch = x86_64
  hw.cpu.ncore = 2
  hw.ramSize = 1536
  hw.screen = multi-touch
  hw.mainKeys = false
  hw.trackBall = false
  hw.keyboard = true
  hw.keyboard.lid = false
  hw.keyboard.charmap = qwerty2
  hw.dPad = false
  hw.rotaryInput = false
  hw.gsmModem = true
  hw.gps = true
  hw.battery = true
  hw.accelerometer = true
  hw.gyroscope = true
  hw.audioInput = true
  hw.audioOutput = true
  hw.sdCard = false
  disk.cachePartition = true
  disk.cachePartition.path = /home/sl/.android/avd/Nexus_5X_API_25.avd/cache.img
  disk.cachePartition.size = 66m
  hw.lcd.width = 1080
  hw.lcd.height = 1920
  hw.lcd.depth = 16
  hw.lcd.density = 420
  hw.lcd.backlight = true
  hw.gpu.enabled = true
  hw.gpu.mode = host
  hw.gpu.blacklisted = no
  hw.initialOrientation = Portrait
  hw.camera.back = none
  hw.camera.front = none
  vm.heapSize = 384
  hw.sensors.light = true
  hw.sensors.pressure = true
  hw.sensors.humidity = true
  hw.sensors.proximity = true
  hw.sensors.magnetic_field = true
  hw.sensors.magnetic_field_uncalibrated = true
  hw.sensors.gyroscope_uncalibrated = true
  hw.sensors.orientation = true
  hw.sensors.temperature = true
  hw.useext4 = true
  hw.arc = false
  hw.arc.autologin = false
  kernel.path = /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu
  kernel.newDeviceNaming = yes
  kernel.supportsYaffs2 = no
  disk.ramdisk.path = /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//ramdisk.img
  disk.systemPartition.initPath = /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//system.img
  disk.systemPartition.size = 2765m
  disk.vendorPartition.size = 0
  disk.dataPartition.path = /home/sl/.android/avd/Nexus_5X_API_25.avd/userdata-qemu.img
  disk.dataPartition.size = 800m
  disk.encryptionKeyPartition.path = /home/sl/.android/avd/Nexus_5X_API_25.avd/encryptionkey.img
  PlayStore.enabled = false
  avd.name = Nexus_5X_API_25
  fastboot.forceColdBoot = false
.
QEMU options list:
emulator: argv[00] = "/home/sl/opt/android-sdk/tools/../emulator/qemu/linux-x86_64/qemu-system-x86_64"
emulator: argv[01] = "-dns-server"
emulator: argv[02] = "127.0.1.1"
emulator: argv[03] = "-serial"
emulator: argv[04] = "null"
emulator: argv[05] = "-device"
emulator: argv[06] = "goldfish_pstore,addr=0xff018000,size=0x10000,file=/home/sl/.android/avd/Nexus_5X_API_25.avd/data/misc/pstore/pstore.bin"
emulator: argv[07] = "-cpu"
emulator: argv[08] = "android64"
emulator: argv[09] = "-enable-kvm"
emulator: argv[10] = "-smp"
emulator: argv[11] = "cores=2"
emulator: argv[12] = "-m"
emulator: argv[13] = "1536"
emulator: argv[14] = "-lcd-density"
emulator: argv[15] = "420"
emulator: argv[16] = "-object"
emulator: argv[17] = "iothread,id=disk-iothread"
emulator: argv[18] = "-nodefaults"
emulator: argv[19] = "-kernel"
emulator: argv[20] = "/home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu"
emulator: argv[21] = "-initrd"
emulator: argv[22] = "/home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//ramdisk.img"
emulator: argv[23] = "-drive"
emulator: argv[24] = "if=none,index=0,id=system,file=/home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//system.img,read-only"
emulator: argv[25] = "-device"
emulator: argv[26] = "virtio-blk-pci,drive=system,iothread=disk-iothread,modern-pio-notify"
emulator: argv[27] = "-drive"
emulator: argv[28] = "if=none,index=1,id=cache,file=/home/sl/.android/avd/Nexus_5X_API_25.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[29] = "-device"
emulator: argv[30] = "virtio-blk-pci,drive=cache,iothread=disk-iothread,modern-pio-notify"
emulator: argv[31] = "-drive"
emulator: argv[32] = "if=none,index=2,id=userdata,file=/home/sl/.android/avd/Nexus_5X_API_25.avd/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[33] = "-device"
emulator: argv[34] = "virtio-blk-pci,drive=userdata,iothread=disk-iothread,modern-pio-notify"
emulator: argv[35] = "-drive"
emulator: argv[36] = "if=none,index=3,id=encrypt,file=/home/sl/.android/avd/Nexus_5X_API_25.avd/encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576"
emulator: argv[37] = "-device"
emulator: argv[38] = "virtio-blk-pci,drive=encrypt,iothread=disk-iothread,modern-pio-notify"
emulator: argv[39] = "-netdev"
emulator: argv[40] = "user,id=mynet"
emulator: argv[41] = "-device"
emulator: argv[42] = "virtio-net-pci,netdev=mynet"
emulator: argv[43] = "-show-cursor"
emulator: argv[44] = "-L"
emulator: argv[45] = "/home/sl/opt/android-sdk/emulator/lib/pc-bios"
emulator: argv[46] = "-soundhw"
emulator: argv[47] = "hda"
emulator: argv[48] = "-vga"
emulator: argv[49] = "none"
emulator: argv[50] = "-append"
emulator: argv[51] = "qemu=1 androidboot.hardware=ranchu clocksource=pit android.qemud=1 console=0 android.checkjni=1 qemu.gles=1 qemu.encrypt=1 qemu.opengles.version=131072 cma=288M qemu.wifi=1 mac80211_hwsim.channels=2 androidboot.android_dt_dir=/sys/bus/platform/devices/ANDR0001:00/properties/android/ ramoops.mem_address=0xff018000 ramoops.mem_size=0x10000 memmap=0x10000$0xff018000"
emulator: argv[52] = "-android-hw"
emulator: argv[53] = "/home/sl/.android/avd/Nexus_5X_API_25.avd/hardware-qemu.ini"
Concatenated QEMU options:
 /home/sl/opt/android-sdk/tools/../emulator/qemu/linux-x86_64/qemu-system-x86_64 -dns-server 127.0.1.1 -serial null -device goldfish_pstore,addr=0xff018000,size=0x10000,file=/home/sl/.android/avd/Nexus_5X_API_25.avd/data/misc/pstore/pstore.bin -cpu android64 -enable-kvm -smp cores=2 -m 1536 -lcd-density 420 -object iothread,id=disk-iothread -nodefaults -kernel /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//kernel-ranchu -initrd /home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//ramdisk.img -drive if=none,index=0,id=system,file=/home/sl/opt/android-sdk/system-images/android-25/google_apis/x86_64//system.img,read-only -device virtio-blk-pci,drive=system,iothread=disk-iothread,modern-pio-notify -drive if=none,index=1,id=cache,file=/home/sl/.android/avd/Nexus_5X_API_25.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=cache,iothread=disk-iothread,modern-pio-notify -drive if=none,index=2,id=userdata,file=/home/sl/.android/avd/Nexus_5X_API_25.avd/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=userdata,iothread=disk-iothread,modern-pio-notify -drive if=none,index=3,id=encrypt,file=/home/sl/.android/avd/Nexus_5X_API_25.avd/encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=encrypt,iothread=disk-iothread,modern-pio-notify -netdev user,id=mynet -device virtio-net-pci,netdev=mynet -show-cursor -L /home/sl/opt/android-sdk/emulator/lib/pc-bios -soundhw hda -vga none -append 'qemu=1 androidboot.hardware=ranchu clocksource=pit android.qemud=1 console=0 android.checkjni=1 qemu.gles=1 qemu.encrypt=1 qemu.opengles.version=131072 cma=288M qemu.wifi=1 mac80211_hwsim.channels=2 androidboot.android_dt_dir=/sys/bus/platform/devices/ANDR0001:00/properties/android/ ramoops.mem_address=0xff018000 ramoops.mem_size=0x10000 memmap=0x10000$0xff018000' -android-hw /home/sl/.android/avd/Nexus_5X_API_25.avd/hardware-qemu.ini
emulator: Android qemu version 27.0.2.0 (build_id 4498654) (CL:f388734068bae38c6115263feea33c68eed531fe)

emulator: Starting QEMU main loop
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'ro.opengles.version' = '131072'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'none'
emulator: Adding boot property: 'dalvik.vm.heapsize' = '384m'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '0'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '420'
emulator: goldfish_events.have-dpad: false
emulator: goldfish_events.have-trackball: false
emulator: goldfish_events.have-camera: false
emulator: goldfish_events.have-keyboard: true
emulator: goldfish_events.have-lidswitch: false
emulator: goldfish_events.have-tabletmode: false
emulator: goldfish_events.have-touch: false
emulator: goldfish_events.have-multitouch: true
emulator: control console listening on port 5554, ADB on port 5555
Not using any http proxy
emulator: android_hw_fingerprint_init: fingerprint qemud listen service initialized




emulator: Warning: config.ini contains invalid skin.path entry: _no_skin
emulator: ERROR: detected a hanging thread 'QEMU2 main loop'. No response for 15000 ms

答案 1 :(得分:10)

RELAX家伙!

实际上可能会出现悬挂状态

  • 启动模拟器
  • 在跑步期间

这可能是在

之后
  • 更新套餐

  • 当你导入或打开一个项目到更高版本的android studio之类的时候 2.4 - &gt; 3.0.1等 主要原因是你以前的应用程序的状态是用以前的android studio的库和包保存的,所以要解决这个错误很容易,即

a)工具 - &gt; AVD-&gt;编辑 - &gt;高级设置。选择快速启动而不是冷启动    (由Kamel回答)

OR

b)如果您已选择“快速启动”,则选择“冷启动”,然后重新启动    模拟器,它会正常工作。

答案 2 :(得分:10)

这对我有用:

我去了工具-> AVD管理器->编辑(特定的模拟器)>显示高级设置

然后在“仿真性能”部分中,选择了“快速启动”,将其更改为“冷启动”,一切开始正常运行。

希望这会有所帮助。

答案 3 :(得分:3)

我们非常高兴地在28台核心计算机上运行27个仿真器,直到2020年12月1日,突然它们开始缓慢运行,平均负载降低1.5倍-2倍,并且这些QEMU消息出现,有时甚至恢复正常。另一个也在其模拟器上运行Android 10的团队在完全不相关的系统上也看到了相同的性能问题。 Android 11和Pie不受影响。

我们的模拟器容器是使用标准的avdmanager创建的AVD进行烹饪的,并将机器快照复制到docker映像中,每个映像一个模拟器,然后我们唤醒其中几个容器。

我们仍然不完全了解原因,但似乎可以通过禁用AVD中的各种设置和应用程序来解决问题;没有这些修复程序的快照图像仍然表现不佳。我们不确定哪一个真正修复了它,因此即使看起来不太可能做出贡献,我也会在这里列出所有内容。如果确定,我将更新此答案:

  • 512M sdcard(avdmanager的-c选项)
  • pm撤销了Quicksearch的RECORD_AUDIO(googlequicksearchbox =天鹅绒)
  • su root pm禁用com.google.android.googlequicksearchbox
  • su root pm禁用com.google.android.music
  • 设置>安全>播放保护>禁用扫描设备
  • 应用信息>播放服务>清除存储,清除缓存,强制停止
  • 应用信息> Google自动>禁用
  • 短暂打开地图,跳过登录,然后单击“缩放到位置”
  • 正常的“解雇初次用户”之类的东西:
    • 授予摄像头权限,不保存位置
    • 不共享任何统计信息或登录Chrome(=不用了,谢谢),强制杀死它以尝试激起数据保存屏幕,然后启动Chrome备份。
  • 此外,Chrome>设置>精简模式>开启,关闭
    • 然后在文本窗口中点击以调出键盘,清除“帮助构建更好的键盘”内容。
    • 检查data / data / com.google.android.inputmethod.latin / shared_prefs / com.googe.android.inputmethod.latin_preferences.xml中的顽皮单词-在构建时,我们没有看到顽皮单词列表“让我们再试一次”图像。
  • 偶然地点击了快速搜索窗口小部件并启用了它;再次禁用它。
  • 我们还需要花费几个小时的时间-以防它在停止模拟器并对其进行快照之前下载了某些内容。

即使存在这些缺陷,我们仍然发现Android 10和Android 11的运行速度比Pie慢10%。

答案 4 :(得分:2)

我有完全相同的问题,在ubuntu 16.04和android studio 3.0.1

点击谷歌搜索此错误信息后:

ADB rejected shell command (getprop): closed

我在the Arch forumn中找到了讨论错误的用户。

一个简单的解决方案是:点击AS中的AVD Manager后>点击使用铅笔图标编辑此AVD&gt;在图形下拉菜单中选择软件。

此模式可能会导致降低仿真器速度,但可以暂时解决问题。

答案 5 :(得分:1)

如果在{strong> Configure IPv6 (配置IPv6)下拉菜单中没有出现off选项(如在macOS 10.14中),则也可以在macOS上启用/禁用ipv6协议,终端中的下一个命令:

networksetup -setv6off Ethernet && networksetup -setv6off Wi-Fi

要启用,只需在配置IPv6 下拉列表中选择先前选择的选项或执行以下其他命令:

networksetup -setv6automatic Wi-Fi && networksetup -setv6automatic Ethernet

答案 6 :(得分:1)

转到工具=> AVD管理器选择要打开的虚拟设备按下笔图标(编辑此AVD) Press this item (Edit this AVD)

选择显示高级设置 Show Advanced Settings

选择引导选项:冷启动Check Cold boot

答案 7 :(得分:0)

开启:

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04.5 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.5 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

要将disable_ipv6的值从1设置为0,以下对我有用:

$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
1
$ sudo sysctl net.ipv6.conf.all.disable_ipv6=0
net.ipv6.conf.all.disable_ipv6 = 0
$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
0

答案 8 :(得分:0)

我已经解决了这个问题。 只需检查您的SDK管理器,是否有可用的更新。如果是,则更新AVD管理器和SDK工具。 然后启动您的AVD。它将像以前一样工作。

答案 9 :(得分:-1)

在工具 - &gt; AVD-&gt;编辑 - &gt;高级设置。选择快速启动而不是冷启动

答案 10 :(得分:-1)

我在Windows中运行Android Studio 3.01。

我不知道这与它有什么关系。我收到了同样的错误消息:

Android Studio模拟器:ERROR:检测到挂起线程QEMU2主循环

我尝试一下这个陈述。这是我得到的痕迹:

  

过程:com.abc.abc,PID:4620
  java.lang.RuntimeException:无法启动活动ComponentInfo {com.abc.abc/com.abc.abc.CheckRegistration}:android.view.InflateException:二进制XML文件行#0:二进制XML文件行#0:

您必须提供layout_width属性。

我在上面的消息上用abc替换了我的域名。

我将布局宽度从“wrap_content”更改为特定宽度123dp。这个改变解决了我的问题。