Android Studio and starting an AVD in Silverblue

I am using the flatpak of Android Studio in one of the atomic desktop spins (eg: Silverblue).

When I attempt to start a virtual AVD it times out and does not start the AVD.

Within the log output, I am seeing the following: UNAVAILABLE: Network closed for unknown reason. Could this indicate that I need to enable some flatpak or udev permission?

Are any of you, on an atomic desktop, able to use the Android Studio flatpak to successfully debug an apk? Perhaps I should be using a different approach than a virtual AVD?

Below is the full log output:

2024-11-09 14:20:20,311 [  47103]   WARN - Emulator: Pixel 6 API 34 - File System is not ext4, disable QuickbootFileBacked feature
2024-11-09 14:20:20,493 [  47285]   WARN - Emulator: Pixel 6 API 34 - Your GPU drivers may have a bug. Switching to software rendering.
2024-11-09 14:20:20,495 [  47287]   WARN - Emulator: Pixel 6 API 34 - emuglConfig_get_vulkan_hardware_gpu: Failed to create vulkan instance error code: -9
2024-11-09 14:20:20,657 [  47449]   WARN - Emulator: Pixel 6 API 34 - *** Basic token auth should only be used by android-studio ***
2024-11-09 14:20:21,341 [  48133]   WARN - #c.i.o.a.ActionStub - ActionGroup should be registered using <group> tag: id="android.device.liveedit.status" class="com.android.tools.idea.editors.liveedit.ui.LiveEditNotificationGroup"
2024-11-09 14:20:42,747 [  69539]   WARN - #com.android.tools.idea.streaming.emulator.EmulatorController - android.emulation.control.EmulatorController/streamScreenshot call failed - UNAVAILABLE: Network closed for unknown reason
2024-11-09 14:20:42,747 [  69539]   WARN - #com.android.tools.idea.streaming.emulator.EmulatorController - android.emulation.control.EmulatorController/streamNotification call failed - UNAVAILABLE: Network closed for unknown reason
2024-11-09 14:20:42,769 [  69561]   WARN - Emulator: Pixel 6 API 34 - Emulator terminated with exit code 139
2024-11-09 14:20:43,238 [  70030]   WARN - #com.android.sdklib.deviceprovisioner.DeviceAction - The emulator process for AVD Pixel_6_API_34 has terminated.
com.android.tools.idea.avdmanager.EmulatorConnectionListener$EmulatorTerminatedException: The emulator process for AVD Pixel_6_API_34 has terminated.
	at com.android.tools.idea.avdmanager.EmulatorConnectionListener$WaitForEmulatorTask.run(EmulatorConnectionListener.java:93)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$1.run(AnyThreadWriteThreadingSupport.kt:134)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Unknown Source)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)

Added flatpak

The flatpak is unofficial and possibly restricted in some ways.

Afaik it is recommended to layer the RPM or install it in a toolbox, from a repo of course.

What is an AVD?

You could try the following (Solved: android emulator has no internet connection | by Stephen Lee | Medium):
Solution

The root cause of the problem is that we set the proxy in android studio, and started the emulator from android studio, but the proxy setting is not correct.

The solutions for the problem are:

Update the proxy to correct one in Android Studio.
Updated the Android Studio with no proxy.

The problem is that when we start the emulator from Android Studio, the proxy setting in Android Studio will be applied to the emulator.

=================================
AVD = Android Virtual Device

Unfortunately, I have tried each of those things with no success:

  1. Android Studio is already set to not use a proxy, and I am not behind a proxy.
  2. I tried installing Android Studio in a toolbox. When attempting to start an AVD from the toolbox Android Studio, I get an error stating that libxkbfile.so.1 shared library cannot be found. I would prefer to get the Flatpak working rather than fighting missing libraries.
  3. There is no RPM for Android Studio, at least in the default repositories, to layer in.

Perhaps I will try the snap version of Android Studio within a toolbox, though I would rather not use yet another package system on top of the two I am already using.

I am surprised I am finding no mention, in searches, of anyone encountering this issue with the Flatpak.

That’s unfortunate.
Not a solution but, in the interim, have you considered connecting a physical device rather than using an emulator? Unless your PC is very beefy the emulator is going to be very slow.

I think your installation is broken somehow.
I just did a clean install of Android Studio (downloaded from Google site, followed installation instructions) on Fedora Workstation 41 and i can´t reproduce your problem.
It’s possible something has changed between 40 and 41 or there’s a difference wrt silverblue.
But given that you can’t find any discussion of this problem I think it most likely is something broken with your installation, rather than the platform.
Not sure what to recommend.

Perhaps - you need to do some special steps in Silverblue to tell Android Studio where to find the network tools.
If so - you need someone au fait with Silverblue and Android Studio.

Oh that is encouraging! My current toolbox is Fedora 39, I now realize. I will try with a Fedora 41 toolbox.