I never tried to run a flatpak from a cron job, but maybe the following could help you a bit?
- Maybe you need to setup
QT_QPA_PLATFORM_PLUGIN_PATH
, so that the app can find the plugins? It apparently often points to/var/lib/flatpak/app/<app-id>/current/active/files/lib/qt6/plugins/platform
. - Maybe flatpak-spawn can be used?
- Maybe compare the
env
output of your cron job and your regular user to find differences? - Apparently some users could use cron if the flatpak was installed with
--user
(rather than--system
) – though their issue was with using the flatpak update command.