Hey, we have a flutter app packaged with snap that runs on ubutu core, recently we introduced a new library for talking with dbus , but we ran into a problem, as below,
2024-10-29T13:48:18Z salto-ssi-outdoor.daemon[25697]: Starting app
2024-10-29T13:48:18Z salto-ssi-outdoor.daemon[25757]: **
2024-10-29T13:48:18Z salto-ssi-outdoor.daemon[25757]: GLib-GObject:ERROR:../../../gobject/gtype.c:2808:g_type_register_static: assertion failed: (static_quark_type_flags)
2024-10-29T13:48:18Z salto-ssi-outdoor.daemon[25757]: Bail out! GLib-GObject:ERROR:../../../gobject/gtype.c:2808:g_type_register_static: assertion failed: (static_quark_type_flags)
but if we do a clean snapcraft build its not happening anymore. But this solve issue temporarily, so next non-clean build it will crash again.
the way we access the DBUS is
void _setupWatchdog() {
Timer.periodic(const Duration(seconds: 10), (_) {
var client = DBusClient.system();
var object = DBusRemoteObject(client, name: 'org.ssi.app.intercom.outdoor.watchdog', path: DBusObjectPath('/org/ssi/app/intercom/outdoor/watchdog'));
object.callMethod('org.ssi.app.intercom.outdoor.watchdog', 'Feed', []);
client.close();
});
}
snapcraft definition
apps:
salto-ssi-outdoor:
....
plugs: &_plugs
....
- dbus-watchdog-object-client
environment: &_environment
XDG_DATA_HOME: $SNAP_USER_DATA
XDG_DATA_DIRS: $SNAP/usr/share
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pulseaudio:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/blas:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lapack"
app-watchdog:
...
slots:
- dbus-watchdog-object-service
environment:
PYTHONPATH: $SNAP/usr/lib/python3/dist-packages:$SNAP/bin:$PYTHONPATH
GI_TYPELIB_PATH: $SNAP/usr/lib/x86_64-linux-gnu/girepository-1.0
plugs:
- devicedata
- network
....
plugs:
dbus-watchdog-object-client:
bus: system
interface: dbus
name: org.ssi.app.intercom.outdoor.watchdog
slots:
dbus-watchdog-object-service:
interface: dbus
bus: system
name: org.ssi.app.intercom.outdoor.watchdog
I was thinking maybe snapcraft somehow associate build with dbus object registration, so that a clean build helps.
Any idea, how to approach for a solution?