Fix Android Emulator Black Screen on Wayland Ubuntu

Craig Oda
2 min readAug 14, 2022

--

Android emulator problem on Wayland

I was having problems running an Android Virtual Device on Wayland on Ubuntu 22.04

The AVD worked on X11, but I wanted to use it on Wayland so that I could experiment with Flutter desktop on Linux Wayland. Using Wayland for both Android and Linux desktop is more convenient.

I was able to successfully launch an AVD under Wayland with the following command from the bash shell.

emulator -avd Pixel_5_API_31 -gpu guest -no-snapshot -wipe-data
Android emulator working on Wayland

People can see if their Linux desktop is running Wayland or X11 by checking the XDG_SESSION_TYPE environmental variable.

echo $XDG_SESSION_TYPE
wayland

I tested Flame and Flutter in the emulator.

flutter run -d emulator-5554 — enable-software-rendering
Flutter and Flame working on Wayland in Android Emulator

Here’s some additional information on my AVD. I do not have Google Play services enabled in this AVD.

AVD with no Google Play services and Software GLES 2.0

I used an AVD without Google Play after I read online that there may be problems with software rendering when Google Play services are included in the AVD.

Flutter apps work reasonably well in the emulator with 360 video captured from the RICOH THETA X, but performance is better on a physical Pixel 2 phone.

Android AVD on Ubuntu Wayland playing a 360 video with Flutter

Summary

The AVD on Wayland looks very usable for Flame game apps, which is how I’m using the AVD on my YouTube channel. For more complex graphics such as 360 video at 4K and 8K, it’s better to use a physical phone.

--

--

Craig Oda
Craig Oda

Written by Craig Oda

open source advocate, writer, Flutter developer, father, husband, fly fisherman, surfer

Responses (2)