Android Studio无VT-x设备用armeabi-v7a AVD卡开机动画无法进桌面
问题详情
我的问题
我遇到的问题:并非Android logo卡住,而是其持续播放开机动画,始终无法进入主屏幕。
我的设备不支持VT-x,因此使用armeabi-v7a镜像。
我已安装Android Studio,当前创建了两台armeabi-v7a架构的虚拟设备,配置如下:
Name: Pixel_3a_API_21 CPU/ABI: Google APIs ARM (armeabi-v7a) Path: C:\Users\USER\.android\avd\Pixel_3a_API_21.avd Target: google_apis [Google APIs] (API level 21) Skin: pixel_3a SD Card: 512 MB fastboot.chosenSnapshotFile: runtime.network.speed: full hw.accelerometer: yes hw.device.name: pixel_3a hw.lcd.width: 1080 hw.initialOrientation: Portrait image.androidVersion.api: 21 tag.id: google_apis hw.mainKeys: no hw.camera.front: webcam0 avd.ini.displayname: Pixel 3a API 21 hw.gpu.mode: off hw.ramSize: 1536 PlayStore.enabled: false fastboot.forceColdBoot: no hw.cpu.ncore: 1 hw.keyboard: yes hw.sensors.proximity: yes hw.dPad: no hw.lcd.height: 2220 vm.heapSize: 256 skin.dynamic: yes hw.device.manufacturer: Google hw.gps: yes hw.audioInput: yes image.sysdir.1: system-images\android-21\google_apis\armeabi-v7a\ hw.cpu.model: cortex-a8 showDeviceFrame: yes hw.camera.back: webcam0 AvdId: Pixel_3a_API_21 hw.lcd.density: 440 hw.arc: false hw.device.hash2: MD5:0e6953ebf01bdc6b33a2f54746629c50 fastboot.forceChosenSnapshotBoot: no fastboot.forceFastBoot: yes hw.trackBall: no hw.battery: yes hw.sdCard: yes tag.display: Google APIs runtime.network.latency: none disk.dataPartition.size: 800M hw.sensors.orientation: yes avd.ini.encoding: UTF-8 hw.gpu.enabled: no
Name: Pixel_4_API_21 CPU/ABI: Google APIs ARM (armeabi-v7a) Path: C:\Users\USER\.android\avd\Pixel_4_API_21.avd Target: google_apis [Google APIs] (API level 21) Skin: pixel_4 SD Card: 512M fastboot.chosenSnapshotFile: runtime.network.speed: full hw.accelerometer: yes hw.device.name: pixel_4 hw.lcd.width: 1080 hw.initialOrientation: Portrait image.androidVersion.api: 21 tag.id: google_apis hw.mainKeys: no hw.camera.front: emulated avd.ini.displayname: Pixel 4 API 21 hw.gpu.mode: auto hw.ramSize: 1536 PlayStore.enabled: false fastboot.forceColdBoot: no hw.cpu.ncore: 1 hw.keyboard: yes hw.sensors.proximity: yes hw.dPad: no hw.lcd.height: 2280 vm.heapSize: 256 skin.dynamic: yes hw.device.manufacturer: Google hw.gps: yes hw.audioInput: yes image.sysdir.1: system-images\android-21\google_apis\armeabi-v7a\ hw.cpu.model: cortex-a8 showDeviceFrame: yes hw.camera.back: virtualscene AvdId: Pixel_4_API_21 hw.lcd.density: 440 hw.arc: false hw.device.hash2: MD5:6b5943207fe196d842659d2e43022e20 fastboot.forceChosenSnapshotBoot: no fastboot.forceFastBoot: yes hw.trackBall: no hw.battery: yes hw.sdCard: yes tag.display: Google APIs runtime.network.latency: none disk.dataPartition.size: 800M hw.sensors.orientation: yes avd.ini.encoding: UTF-8 hw.gpu.enabled: yes
两台设备均存在上述问题,AVD启动时先弹出错误提示,随后进入持续开机动画状态。
为排查问题,我进入E:\ANDROIDSDKLOCATION\emulator目录,通过cmd命令启动模拟器,复现问题的同时cmd输出了多条错误日志:
E:\ANDROIDSDK\emulator>emulator -avd Pixel_4_API_21 emulator: Android emulator version 30.7.4.0 (build_id 7453540) (CL:N/A) emulator: WARNING: encryption is off emulator: WARNING: Your GPU drivers may have a bug. Switching to software rendering. cannot add library vulkan-1.dll: failed cannot add library vulkan-1.dll: failed Failed to open unused/windows_msvc-x86_64/qemu.conf, err: 2 Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT +UG features is currently needed. We will address this in a future release. emulator: INFO: GrpcServices.cpp:315: Started GRPC server at 127.0.0.1:8554, security: Local emulator: INFO: EmulatorAdvertisement.cpp:93: Advertising in: C:\Users\USER\AppData\Local\Temp\avd\running\pid_3520.ini emulator: emulator window was out of view and was recentered
我判断以下3个错误是问题根源,尝试寻找解决方案:
cannot add library vulkan-1.dll: failed cannot add library vulkan-1.dll: failed Failed to open unused/windows_msvc-x86_64/qemu.conf, err: 2
我添加了vulkan库,同时在cmd执行E:\ANDROIDSDK\emulator>echo # > \qemu.conf,上述3个错误已消失。
当前启动AVD的cmd日志如下:
E:\ANDROIDSDK\emulator>emulator -avd Pixel_4_API_21 emulator: Android emulator version 30.7.5.0 (build_id 7491168) (CL:N/A) emulator: WARNING: encryption is off emulator: WARNING: Your GPU drivers may have a bug. Switching to software render ing. added library vulkan-1.dll Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release. emulator: INFO: GrpcServices.cpp:315: Started GRPC server at 127.0.0.1:8554, sec urity: Local emulator: INFO: EmulatorAdvertisement.cpp:93: Advertising in: C:\Users\USER\AppD ata\Local\Temp\avd\running\pid_4128.ini
但设备仍无法进入主屏幕,目前cmd仍有以下警告提示,同时弹出弹窗警告:
emulator: WARNING: encryption is off emulator: WARNING: Your GPU drivers may have a bug. Switching to software rendering. Warning: Quick Boot / Snapshots not supported on this machine. A CPU with EPT + UG features is currently needed. We will address this in a future release.
请问我还需要进行哪些配置才能解决持续开机动画无法进入主屏幕的问题?
解决方案
按照以下步骤依次操作即可解决问题:
- 强制关闭快速启动,使用冷启动模式
你的CPU不支持EPT+UG特性,无法使用Quick Boot快照功能,必须切换为冷启动:
- 打开AVD管理器,点击对应设备右侧的下拉箭头,选择「Cold Boot Now」直接启动
- 或修改AVD配置文件,将
fastboot.forceFastBoot改为no,fastboot.forceColdBoot改为yes,后续启动会自动使用冷启动模式
- 降低AVD硬件配置负载
无硬件加速的ARM模拟器性能极低,高分辨率高配置设备会导致启动卡死:
- 新建AVD时选择低配置设备,比如Nexus S,分辨率降到480*800
- 将RAM分配调整为1024M,heapSize调整为128M,CPU核心数保持1核不变
- 关闭不必要的硬件功能:前后摄像头、GPS、各类传感器都设置为emulated/none,降低运行负载
- 统一关闭GPU加速
你的GPU驱动存在兼容性问题,已经自动切换为软件渲染,关闭GPU配置避免冲突:
- 修改两台AVD的配置,将
hw.gpu.enabled改为no,hw.gpu.mode改为off
- 扩大系统分区容量
当前disk.dataPartition.size仅为800M,系统运行缓存很容易占满导致启动失败,将该参数修改为2G - 更换更低API版本的ARM镜像
API 21的armeabi-v7a镜像在无VT-x设备上兼容性一般,可尝试更换为API 19或API 17的ARM镜像,启动成功率更高
注意:无硬件加速的ARM模拟器首次冷启动速度极慢,最多可能需要等待30分钟,等待超过30分钟未进入系统再排查其他问题。
内容的提问来源于stack exchange,提问作者redoc
相关产品推荐
相关产品推荐

