Apps installed from snap or flatpak do not start. The error seems to be “Invalid MIT-MAGIC-COOKIE-1”.
Try to open ANKI installed with snap:
> env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/anki-woodrow_anki.desktop /snap/bin/anki-woodrow.anki %f (base)
File "/snap/anki-woodrow/35/bin/anki", line 3, in <module>
aqt.run()
File "/snap/anki-woodrow/35/lib/python3.8/site-packages/aqt/__init__.py", line 400, in run
_run()
File "/snap/anki-woodrow/35/lib/python3.8/site-packages/aqt/__init__.py", line 443, in _run
pmLoadResult = pm.setupMeta()
File "/snap/anki-woodrow/35/lib/python3.8/site-packages/aqt/profiles.py", line 91, in setupMeta
res = self._loadMeta()
File "/snap/anki-woodrow/35/lib/python3.8/site-packages/aqt/profiles.py", line 464, in _loadMeta
traceback.print_stack()
resetting corrupt _global
Invalid MIT-MAGIC-COOKIE-1 keyQt warning: could not connect to display :0.0
Qt info: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Qt fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
fish: “env BAMF_DESKTOP_FILE_HINT=/var…” terminated by signal SIGABRT (Abort)
Try to open ANKI installed with flatpak:
> flatpak run net.ankiweb.Anki
Invalid MIT-MAGIC-COOKIE-1 keyQt warning: could not connect to display :99.0
Qt info: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Qt fatal: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
Temp Fix:
App (at least for flatpak) work normally after deleting Xauthority in the home directory.
rm .Xauthority
sudo shutdown -r now