GDBus.Error:org.freedesktop.DBus.Error.AccessDenied:

Can someone tell me how to fix this issue? :cry: When I do flutter run I get this error:

Failed to register: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type=“method_call”, sender=":1.127" (uid=1000 pid=5308 comm="/home/fearsome/Downloads/software/build/linux/x64/debu" label=“snap.flutter.flutter (complain)”) interface=“org.gtk.Actions” member=“DescribeAll” error name="(unset)" requested_reply=“0” destination=“io.snapcraft.Store” (uid=1000 pid=2455 comm="/snap/snap-store/638/usr/bin/snap-store --gapplica" label=“snap.snap-store.snap-store (enforce)”)

Error waiting for a debug connection: The log reader stopped unexpectedly, or never started. Error launching application on Linux.

Install snappy-debug from snapstore, and then open two different terminal session in one run the command --> snappy-debug and in the other window run flutter run, then please share the output of snappy-debug

Hi, sorry for the slow reply. Flutter stops after just a few seconds, but I let snappy-debug run for a while. Here is the output:

snappy-debug
INFO: Following '/var/log/syslog'. If have dropped messages, use:
INFO: $ sudo journalctl --output=short --follow --all | sudo snappy-debug
= AppArmor =
Time: 2023-03-18T00:1
Log: apparmor="DENIED" operation="dbus_method_call"  bus="session" path="/io/snapcraft/Store" interface="org.gtk.Actions" member="DescribeAll" name=":1.126" mask="receive" pid=2444 label="snap.snap-store.snap-store" peer_pid=4158 peer_label="snap.flutter.flutter"
DBus access

= AppArmor =
Time: 2023-03-18T00:1
Log: apparmor="DENIED" operation="capable" profile="/usr/lib/snapd/snap-confine" pid=4174 comm="snap-confine" capability=12  capname="net_admin"
Capability: net_admin
Suggestions:
* adjust program to not require 'CAP_NET_ADMIN' (see 'man 7 capabilities')
* add one of 'bluetooth-control, firewall-control, netlink-audit, netlink-connector, network-control, qualcomm-ipc-router' to 'plugs'
* do nothing if using systemd utility (eg, timedatectl): https://forum.snapcraft.io/t/managing-time-date-and-timezone-in-ubuntu-core/408/44
* do nothing (https://launchpad.net/bugs/1465724)

= AppArmor =
Time: 2023-03-18T00:1
Log: apparmor="DENIED" operation="capable" profile="/usr/lib/snapd/snap-confine" pid=4174 comm="snap-confine" capability=38  capname="perfmon"
Capability: perfmon
Suggestions:
* adjust program to not require 'CAP_PERFMON' (see 'man 7 capabilities')
* do nothing if program otherwise works properly

= AppArmor =
Time: 2023-03-18T00:1
Log: apparmor="DENIED" operation="open" profile="snap-update-ns.firefox" name="/var/lib/" pid=4195 comm="5" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
File: /var/lib/ (read)
Suggestions:
* adjust program to read necessary files from $SNAP, $SNAP_DATA, $SNAP_COMMON, $SNAP_USER_DATA or $SNAP_USER_COMMON
* adjust snap to use snap layouts (https://forum.snapcraft.io/t/snap-layouts/7207)

= Seccomp =
Time: 2023-03-18T00:1
Log: auid=1000 uid=1000 gid=1000 ses=2 subj=? pid=4174 comm="firefox" exe="/snap/firefox/2453/usr/lib/firefox/firefox" sig=0 arch=c000003e 314(sched_setattr) compat=0 ip=0x7fe8092a9a3d code=0x50000
Syscall: sched_setattr
Suggestion:
* add 'process-control' to 'plugs'

Try to Implent the suggestions and feedbacks of snappy debug in your snap for example it suggest you to use layouts, see this article for understanding about layouts --> https://snapcraft.io/docs/snap-layouts, you will also have to use the environment block to make your snap read $SNAP_USER_DATA etc., it also suggests to add some more plugs and yes i am checking out the dbus one…