Reputation: 38672
Trying to start an emulator in Android Studio gives me the following error:
The emulator process for AVD Pixel_4_API_30_-_GooglePlay has terminated.
I get the following errors logged in Android Studio logs:
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
The error boils down to:
cannot add library /home/werner/Android/Sdk/emulator/qemu/linux-x86_64/lib64/vulkan/libvulkan.so: failed
This is under Ubuntu 20.04 with Android Studio 2020.03.1 and the emulator plugin version 30.7.5.0.
What I've seen/tried:
handleCpuAcceleration: feature check for hvf [1] 1694643 segmentation fault (core dumped)
, but no Vulkan-related error messagesWhen I run the emulator with -gpu guest
, everything works fine.
This means that when I manually change the file ~/.android/avd/Pixel_4_API_30_-_GooglePlay.avd/config.ini
to set hw.gpu.mode
from auto
to guest
, it runs fine. I consider this a workaround and not a real solution, as HW rendering will not not work anymore, and with SW rendering, the System UI of the emulator keeps crashing every couple of seconds.
Upvotes: 10
Views: 8789
Reputation: 1
I upgraded the graphics driver and it's fine. This error doesn't affect use
Upvotes: -1
Reputation: 1224
I had similar issues. What worked for me is updating to the newest version of Android Studio, and then manually updating the emulator version:
Upvotes: 0
Reputation: 38672
The issue was solved by updating the system packages via:
sudo apt update && sudo apt dist-upgrade
In my case, it was installing the latest version of mesa-vulkan-drivers
that probably fixed the issue. I hadn't upgraded my system in a while.
Upvotes: 7
Reputation: 3737
If sudo ubuntu-drivers autoinstall
fails, you can also select the latest proprietary driver yourselve:
Apply
(this takes a while) and reboot your systemUpvotes: 1
Reputation: 365
My solution was similar to @slhck but instead I changed Nvidia GPU drivers to use the recommended version.
sudo ubuntu-drivers autoinstall
sudo reboot
https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-20-04-focal-fossa-linux
Upvotes: 6