web-dev-qa-db-fra.com

Émulateur Android Studio: ERREUR: détection d'une boucle principale QEMU2 en suspens.

J'utilise Android Studio 3.0.1 sur Ubuntu 16.04. 

Hier, Android Studio a affiché un message indiquant qu'une mise à jour était disponible, et je clique toujours sur celle-ci. Il m'a alors informé qu'il avait mis à jour l'émulateur avec succès.

Mon AVD fonctionnait parfaitement avant, mais après la mise à jour, lorsque je le lance, il affiche un écran noir dans la fenêtre de l'émulateur pendant 15 secondes, puis se bloque avec le message d'erreur suivant:

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

J'ai essayé les solutions suggérées dans tous les threads décrivant des problèmes similaires d'émulateur. (J'ai vérifié que l'émulateur est toujours installé via le SDK Manager, j'ai essayé de basculer entre le logiciel et les paramètres graphiques matériels de l'AVD, j'ai essayé de remplacer libstdc ++ par une version plus récente, la version 6.0.24. J'ai essayé plutôt de ln -sf my/usr/lib .. libstdc ++ 6.0.21 dans le dossier de l'émulateur SDK lib64/libstdc ++, j'ai même téléchargé Android Studio et lancé une nouvelle installation avec son propre nouveau dossier SDK avec des SDK fraîchement téléchargés. J'ai essayé de créer de nouveaux AVD avec différentes architectures (arm) et différents niveaux d’API (24, 27), j’ai essayé de redémarrer ADB, et même de redémarrer l’ordinateur.

Le menu Outils de mon SDK ne contient pas d'entrée pour l'accélérateur d'émulateur (HAXM), bien que mon PC dispose d'un processeur Intel: je ne devrais pas avoir à le changer car mon AVD fonctionnait encore hier! Qu'est-ce qui s'est cassé?

Qu'est-ce qui cause le blocage de la boucle principale QEMU2 et comment puis-je résoudre ce problème?

9
fasti

J'ai trouvé une solution provisoire - assurez-vous qu'IPv6 est activé. 

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

Si vous voyez 1 ci-dessus, éditez votre fichier /etc/sysctl.conf et mettez en commentaire toutes les directives de désactivation IPv6:

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

Mise à jour du 5 janvier '18: au moins un utilisateur a signalé que la désactivation d'un IPv6 activé précédemment avait résolu le problème sur son système. Dans ce cas, vous pouvez essayer d'inverser les étapes ci-dessus si IPv6 est déjà activé sur votre système et que l'émulateur ne démarre pas.


J'ai commencé à rencontrer exactement le même problème après la dernière mise à jour du SDK Android sur mon Ubuntu 16.04. L'exécutable ne contient pas de symboles, je ne sais donc pas comment indiquer le développeur d'origine à la cause première du problème, mais voici l'état des threads:

(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

Journal de sortie:

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
8
Slawomir

RELAX les gars!

En fait, l'état suspendu peut se produire 

  • au démarrage de l'émulateur 
  • pendant la course

et cela peut être après

  • mise à jour des paquets

  • lorsque vous importez ou ouvrez un projet dans une version supérieure d'Android Studio, telle que 2.4 -> 3.0.1, etc., la raison principale est que l'état de votre application précédente est enregistré avec les bibliothèques et les packages précédents d'Android Studio. cette erreur est facile à savoir

a) Outils-> AVD-> Édition-> paramètres avancés. choisissez un démarrage rapide au lieu d'un démarrage à froid (comme répondu par Kamel) 

OR

b) si vous avez déjà choisi «démarrage rapide», choisissez «démarrage à froid» et redémarrez émulateur, cela fonctionnera bien.

3
abdurrab

C'est ce qui a fonctionné pour moi:

Je suis allé dans Outils-> Gestionnaire AVD-> Éditer (l'émulateur particulier)> Afficher les paramètres avancés

Ensuite, dans la section Performances émulées, le démarrage rapide a été sélectionné, puis modifié pour un démarrage à froid.

J'espère que cela t'aides.

2
Muhamed Krasniqi

j'ai eu exactement le même problème, dans Ubuntu 16.04 et Android Studio 3.0.1

après un peu googler avec ce message d'erreur:

ADB rejected Shell command (getprop): closed

j'ai trouvé un utilisateur dans the arch forumn qui a discuté de l'erreur.

une solution simple consiste à: après avoir cliqué sur le gestionnaire AVD dans AS> cliquez sur Éditer cet AVD avec une icône représentant un crayon> dans le menu déroulant Graphiques, choisissez Logiciel.

ce mode peut entraîner une diminution de la vitesse de l'émulateur mais peut constituer une solution temporaire au problème.

1
ilia