Apparmor parser error when trying to install snap-store on debian 12

After using sudo snap install snap-store, i get the errors:

error: cannot perform the following tasks:

  • Setup snap “snap-store” (959) security profiles (cannot setup profiles for snap “snap-store”: cannot load ap parmor profiles: exit status 1 apparmor_parser output: AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap-update-ns.snap-store in profile /etc/apparmor. d/tunables/global at line 1: Lexer found unexpected character: ‘$’ (0x24) in state: INITIAL AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap.snap-store.hook.configure in profile /etc/appa rmor.d/tunables/global at line 1: Lexer found unexpected character: ‘$’ (0x24) in state: INITIAL AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap.snap-store.snap-store in profile /etc/apparmor .d/tunables/global at line 1: Lexer found unexpected character: ‘$’ (0x24) in state: INITIAL AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap.snap-store.ubuntu-software in profile /etc/app armor.d/tunables/global at line 1: Lexer found unexpected character: ‘$’ (0x24) in state: INITIAL AppArmor parser error for /var/lib/snapd/apparmor/profiles/snap.snap-store.ubuntu-software-local-file in profi le /etc/apparmor.d/tunables/global at line 1: Lexer found unexpected character: ‘$’ (0x24) in state: INITIAL )
  • Automatically connect eligible plugs and slots of snap “gnome-42-2204” (internal error: auto-connect of &{“s nap-store:gnome-42-2204” “gnome-42-2204:gnome-42-2204”} failed: no state entry for key)