asimfarooq5@ubuntu:~$ flutterdemo
error: error running snapctl: snap "flutterdemo" has no plug or slot named "pulseaudio"
WARNING: pulseaudio interface not connected! Please run: /snap/flutterdemo/current/bin/setup.sh
Setting up watches.
Watches established.
asimfarooq5@ubuntu:~$ snap logs flutterdemo
2022-01-11T14:39:18Z flutterdemo.daemon[1620]: WARNING: pulseaudio interface not connected! Please run: /snap/flutterdemo/current/bin/setup.sh
2022-01-11T14:39:18Z -[1620]: g_dbus_proxy_new_sync: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
2022-01-11T14:39:18Z flutterdemo.daemon[1620]: Couldn't open libGLESv1_CM.so.1: libGLESv1_CM.so.1: cannot open shared object file: No such file or directory
2022-01-11T14:39:18Z systemd[1]: snap.flutterdemo.daemon.service: Main process exited, code=exited, status=1/FAILURE
2022-01-11T14:39:18Z systemd[1]: snap.flutterdemo.daemon.service: Failed with result 'exit-code'.
2022-01-11T14:39:18Z systemd[1]: snap.flutterdemo.daemon.service: Scheduled restart job, restart counter is at 6.
2022-01-11T14:39:18Z systemd[1]: Stopped Service for snap application flutterdemo.daemon.
2022-01-11T14:39:18Z systemd[1]: snap.flutterdemo.daemon.service: Start request repeated too quickly.
2022-01-11T14:39:18Z systemd[1]: snap.flutterdemo.daemon.service: Failed with result 'exit-code'.
2022-01-11T14:39:18Z systemd[1]: Failed to start Service for snap application flutterdemo.daemon.
asimfarooq5@ubuntu:~$ flutterdemo
Setting up watches.
Watches established.
asimfarooq5@ubuntu:~$ snap logs flutterdemo
2022-01-12T11:25:28Z flutterdemo.daemon[2498]: + exec /snap/flutterdemo/x2/bin/wayland-launch /snap/flutterdemo/x2/bin/flutterdemo
2022-01-12T11:25:28Z -[2498]: g_dbus_proxy_new_sync: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
2022-01-12T11:25:28Z flutterdemo.daemon[2498]: Couldn't open libGLESv1_CM.so.1: libGLESv1_CM.so.1: cannot open shared object file: No such file or directory
2022-01-12T11:25:28Z systemd[1]: snap.flutterdemo.daemon.service: Main process exited, code=exited, status=1/FAILURE
2022-01-12T11:25:28Z systemd[1]: snap.flutterdemo.daemon.service: Failed with result 'exit-code'.
2022-01-12T11:25:28Z systemd[1]: snap.flutterdemo.daemon.service: Scheduled restart job, restart counter is at 5.
2022-01-12T11:25:28Z systemd[1]: Stopped Service for snap application flutterdemo.daemon.
2022-01-12T11:25:28Z systemd[1]: snap.flutterdemo.daemon.service: Start request repeated too quickly.
2022-01-12T11:25:28Z systemd[1]: snap.flutterdemo.daemon.service: Failed with result 'exit-code'.
2022-01-12T11:25:28Z systemd[1]: Failed to start Service for snap application flutterdemo.daemon.
Cool. In that case, you simply need to remove the GDK_GL: gles lines from your snapcraft recipe and repackage. These lines are there because they are needed on some devices (e.g. RPi4). Unfortunately, it seems that they break things on QEMU.
We’ll need to do some more investigation into how to get this example working across all devices.
OK, the root cause is that the gnome-3-28-1804 snap is intended for desktop use and, since for amd64, there’s no need for GLES it doesn’t contain libgles1.
There’s another approach to building Flutter snaps for Core that does work across devices. The general approach is described here:
Hi, I’m trying to run this example in a raspberry pi 4 using ubuntu core 20, but after install ubuntu-frame and the super-cool-app snap, I only get the grey wallpaper from ubuntu-frame but no signal of the flutter app.
I added this to the snapcraft.yaml file to make the snap compatible with armhf architercture:
architectures:
- build-on: amd64
run-on: armhf
Also, when I run super-cool-app on the command line, I get this messages:
error: error running snapctl: snap "super-cool-app" has no plug or slot named "pulseaudio"
WARNING: pulseaudio interface not connected! Please run: /snap/super-cool-app/current/bin/setup.sh
/snap/super-cool-app/x2/bin/wayland-launch: 22: /snap/super-cool-app/x2/bin/wayland-launch: inotifywait: Exec format error