【发布时间】:2021-08-11 11:55:58
【问题描述】:
尝试在 Android Studio 中启动模拟器时出现以下错误:
AVD Pixel_4_API_30__-_GooglePlay 的模拟器进程已终止。
我在 Android Studio 日志中记录了以下错误:
2021-08-11 13:38:19,827 [ 290921] INFO - manager.EmulatorProcessHandler - Emulator: /home/werner/Android/Sdk/emulator/emulator -netdelay none -netspeed full -no-snapshot-load -avd Pixel_4_API_30_-_GooglePlay
2021-08-11 13:38:19,885 [ 290979] INFO - manager.EmulatorProcessHandler - Emulator: handleCpuAcceleration: feature check for hvf
2021-08-11 13:38:19,927 [ 291021] INFO - manager.EmulatorProcessHandler - Emulator: cannot add library /home/werner/Android/Sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
2021-08-11 13:38:19,933 [ 291027] INFO - manager.EmulatorProcessHandler - Emulator: added library /home/werner/Android/Sdk/emulator/lib64/vulkan/libvulkan.so
2021-08-11 13:38:20,091 [ 291185] INFO - manager.EmulatorProcessHandler - Emulator: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
2021-08-11 13:38:20,091 [ 291185] WARN - manager.EmulatorProcessHandler - Emulator terminated with exit code 139
错误归结为:
无法添加库/home/werner/Android/Sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so:失败
这是在带有 Android Studio 2020.03.1 和模拟器插件版本 30.7.5.0 的 Ubuntu 20.04 下。
我看到/尝试过的:
- 我已经尝试创建一个新的模拟器,但出现了同样的问题。
- This question 类似,但解决方案适用于 macOS
- Another answer 建议卸载和重新安装模拟器插件也对我不起作用
-
This answer 建议另一个配置,这也会导致分段错误(
handleCpuAcceleration: feature check for hvf [1] 1694643 segmentation fault (core dumped),但没有与 Vulkan 相关的错误消息
当我使用-gpu guest 运行模拟器时,一切正常。
这意味着当我手动更改文件~/.android/avd/Pixel_4_API_30_-_GooglePlay.avd/config.ini 以将hw.gpu.mode 从auto 设置为guest 时,它运行良好。我认为这是一种解决方法,而不是真正的解决方案,因为硬件渲染将不再起作用,并且使用软件渲染,模拟器的系统 UI 每隔几秒钟就会崩溃一次。
【问题讨论】:
标签: android android-studio android-emulator android-studio-arctic-fox