【问题标题】:Android emulator not booting in VMAndroid模拟器无法在VM中启动
【发布时间】:2018-05-22 16:21:37
【问题描述】:

我在我的虚拟机中使用版本为 3.1.2 的 Android Studio。我在 AVD 上创建了 ARM 映像,并尝试使用以下命令运行它

emulator -avd Pixel_API_27 -netspeed full -netdelay none -no-snapshot -debug-init -logcat '*:v'

模拟器可以打开,但是黑屏。在终端日志中,我看到以下日志开始崩溃

 01-01 00:00:15.594 657 657 D libEGL : loaded /system/lib/egl/libGLES_android.so
01-01 00:00:16.670 657 657 D gralloc_ranchu: Emulator without host-side GPU emulation detected. Loading gralloc.default.so from /vendor/lib/hw/gralloc.default.so...
01-01 00:00:16.682 657 657 D gralloc_ranchu: gralloc.default.so not found in /vendor. Trying /system/lib/hw/gralloc.default.so...
01-01 00:00:16.729 657 657 E hwcomposer: ranchu_hw_composer hwc_open could not open framebuffer
01-01 00:00:16.752 657 657 I SurfaceFlinger: Using composer version 1.1
--------- beginning of crash
01-01 00:00:16.758 657 657 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x44 in tid 657 (surfaceflinger)
01-01 00:00:17.085 647 674 V vold : /dev/block/vold/disk:254,48: LABEL="SDCARD" UUID="1711-2E16" TYPE="vfat"
01-01 00:00:17.153 662 662 I SELinux : SELinux: Loaded file_contexts contexts from /file_contexts.
01-01 00:00:17.256 662 662 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-01 00:00:17.257 662 662 F DEBUG : Build fingerprint: 'Android/sdk_google_phone_armv7/generic:6.0/MASTER/4729342:userdebug/test-keys'
01-01 00:00:17.258 662 662 F DEBUG : Revision: '0'
01-01 00:00:17.258 662 662 F DEBUG : ABI: 'arm'
01-01 00:00:17.261 662 662 F DEBUG : pid: 657, tid: 657, name: surfaceflinger >>> /system/bin/surfaceflinger <<<
01-01 00:00:17.312 662 662 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x44
01-01 00:00:17.578 662 662 F DEBUG : r0 b6682000 r1 00000000 r2 00000000 r3 00000001
01-01 00:00:17.579 662 662 F DEBUG : r4 00000000 r5 b6682000 r6 beb6b9e8 r7 b6f7e5b0
01-01 00:00:17.579 662 662 F DEBUG : r8 00000000 r9 b65e5b2d sl b65e5c92 fp 00000000
01-01 00:00:17.579 662 662 F DEBUG : ip 00000000 sp beb6b788 lr b6f70281 pc b65e3600 cpsr 80000170
01-01 00:00:18.006 662 662 F DEBUG :
01-01 00:00:18.006 662 662 F DEBUG : backtrace:
01-01 00:00:18.007 662 662 F DEBUG : #00 pc 00001600 /system/lib/hw/hwcomposer.ranchu.so
01-01 00:00:18.007 662 662 F DEBUG : #01 pc 0002327f /system/lib/libsurfaceflinger.so
01-01 00:00:18.008 662 662 F DEBUG : #02 pc 00022d59 /system/lib/libsurfaceflinger.so
01-01 00:00:18.009 662 662 F DEBUG : #03 pc 000188df /system/lib/libsurfaceflinger.so (android::SurfaceFlinger::init()+98)
01-01 00:00:18.009 662 662 F DEBUG : #04 pc 00000e9d /system/bin/surfaceflinger
01-01 00:00:18.010 662 662 F DEBUG : #05 pc 0001733d /system/lib/libc.so (__libc_init+44)
01-01 00:00:18.010 662 662 F DEBUG : #06 pc 00000d60 /system/bin/surfaceflinger
01-01 00:00:28.838 665 665 I mediaserver: ServiceManager: 0xb604e120
01-01 00:00:28.840 665 665 I AudioFlinger: Using default 3000 mSec as standby time.
01-01 00:00:28.923 665 665 E : batterystats service unavailable!
01-01 00:00:28.927 665 665 E : batterystats service unavailable!
01-01 00:00:28.957 665 665 I CameraService: CameraService started (pid=665)
01-01 00:00:28.958 665 665 I CameraService: CameraService process starting
01-01 00:00:28.963 665 665 E : batterystats service unavailable!
01-01 00:00:28.982 665 665 E : batterystats service unavailable!
01-01 00:00:29.345 665 665 D EmulatedCamera_QemuClient: Emulated camera list: name=virtualscene channel=0 pix=876758866 dir=back framedims=640x480,352x288,320x240,176x144,1280x720,1280x960

它不断重复同样的错误。 请帮我解决这个问题。我只需要运行模拟器,因为我使用的是虚拟机

提前致谢

【问题讨论】:

  • 你也测试过软件渲染的模拟器吗?它有效吗?默认情况下,模拟器是硬件渲染的。

标签: android android-studio android-emulator virtual-machine avd


【解决方案1】:

我遇到了同样的问题,可能与“使用主机 GPU”选项有关。检查复选框模拟器设置(停用或激活它)或选择“软件 GLES 2.0”以在模拟性能中禁用主机 GPU,然后重试。希望能帮到你

【讨论】:

  • 我没有在模拟器->设置下找到“使用主机GPU”选项
  • @Mallikarjuna 在“模拟性能”中,选择“软件 GLES 2.0”以禁用主机 GPU
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-09-29
  • 2016-08-09
  • 2012-04-13
相关资源
最近更新 更多