Android Emulator does not start after Arctic Fox upgrade, libvulkan.so: failed
Asked Answered
E

4

10

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:

  • I have already tried creating a new emulator, but the same issue occurs.
  • This question is similar but the solution is for macOS
  • Another answer suggesting uninstallation and reinstallation of the Emulator plugin also didn't work for me
  • This answer suggests another config, which also leads to a segmentation fault (handleCpuAcceleration: feature check for hvf [1] 1694643 segmentation fault (core dumped), but no Vulkan-related error messages

When 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.

Ep answered 11/8, 2021 at 11:55 Comment(0)
E
7

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.

Ep answered 16/8, 2021 at 14:41 Comment(0)
E
6

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

Elastance answered 28/9, 2021 at 18:7 Comment(0)
I
1

If sudo ubuntu-drivers autoinstall fails, you can also select the latest proprietary driver yourselve:

  • Open "Additional Drivers" in the Ubuntu Launcher
  • Select the latest proprietary driver listed here
  • Apply (this takes a while) and reboot your system

enter image description here

Incontrollable answered 12/4, 2023 at 8:18 Comment(0)
P
0

I had similar issues. What worked for me is updating to the newest version of Android Studio, and then manually updating the emulator version:

  • Open Android Studio > 3 dots in top right corner (More actions) > SDK Manager > Language & Frameworks > Android SDK > SDK Tools tab
  • Update at least these 4: Android SDK Build-Tools, Android SDK Command-line Tools, Android Emulator, Android SDK Platform-Tools
Petrochemistry answered 5/6, 2024 at 18:13 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.