Configuração do plugin Qt para virtualização


>> ~/Android/Sdk/emulator/emulator @Medium_Phone_API_36
INFO         | Android emulator version 35.4.9.0 (build_id 13025442) (CL:N/A)
INFO         | Graphics backend: gfxstream
INFO         | Found systemPath /home/USER/Android/Sdk/system-images/android-36/google_apis_playstore/x86_64/
WARNING      | Please update the emulator to one that supports the feature(s): VulkanVirtualQueue
INFO         | Checking system compatibility:
INFO         |   Checking: hasSufficientDiskSpace
INFO         |      Ok: Disk space requirements to run avd: `Medium_Phone_API_36` are met
INFO         |   Checking: hasSufficientHwGpu
INFO         |      Ok: Hardware GPU requirements to run avd: `Medium_Phone_API_36` are passed
INFO         |   Checking: hasSufficientSystem
INFO         |      Ok: System requirements to run avd: `Medium_Phone_API_36` are met
INFO         | Warning: Could not find the Qt platform plugin "wayland" in "/home/USER/Android/Sdk/emulator/lib64/qt/plugins" (:0, )
INFO         | Fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: xcb, minimal, vnc, offscreen, linuxfb.
 (:0, )
fish: Tarefa 1, '~/Android/Sdk/emulator/emulator…' encerrada pelo sinal SIGABRT (Abort)

Esse erro ocorre por causa da falta ou má configuração do plugin Qt necessário para a interface gráfica do emulador no Linux. O plugin “wayland” não foi encontrado, e a inicialização falhou.

Segue o passo a passo para resolver:

1. Force o uso do plugin xcb

Adicione a variável de ambiente QT_QPA_PLATFORM com o valor xcb antes de iniciar o emulador:

QT_QPA_PLATFORM=xcb ~/Android/Sdk/emulator/emulator @Medium_Phone_API_36

Ou, para manter sempre configurado, adicione no ~/.bashrc ou ~/.config/fish/config.fish (caso use o fish shell):

set -x QT_QPA_PLATFORM xcb

Depois, reinicie o terminal.

2. Instale dependências do Qt

sudo pacman -S libxkbcommon-x11

Essas bibliotecas são essenciais para o plugin xcb.

3. Evite o uso de Wayland

Muitas distribuições modernas usam o Wayland como padrão. Para maior compatibilidade com o Android Emulator, prefira iniciar a sessão gráfica em X11/Xorg ao fazer login no sistema.

Na tela de login (GDM, SDDM, etc), escolha “Xorg” ou “X11” como sessão.

Referências


Configuração do KVM (Kernel-based Virtual Machine) no Arch Linux