Building my first Flatpak

I’m trying to build my first flatpak app. Most of things already work fine, except opening files from my host home directory. I’ve already added --filesystem=home to the manifest.
I can open the file dialog and choose the file, but then I got the error message:

Could not read from: /run/user/1000/doc/d7cd3328/Canboulay.ly

No such file or directory (2)

So the file is copied from the host within the flatpak container, but for some reason it cannot read it.
I’m running the built flatpak from the build directory:

[fede@localhost d7cd3328]$ pwd
/home/fede/src/flatpak/frescobaldi/_build/var/run/user/1000/doc/d7cd3328
[fede@localhost d7cd3328]$ ls -lh
totale 12K
-rw-r--r--. 1 fede fede 8,8K  1 ago  2017 Canboulay.ly

Let me know if you need further information.

  • How are you running the flatpak?
  • Does systemctl --user restart xdg-document-portal fix it?

I’m using this command:

flatpak-builder --run  _build org.frescobaldi.Frescobaldi.yml frescobaldi

I’ve tried running the systemctl command (in the host) and then launched the flatpak app. Got the same error.

@refi64 I’ve put the manifest in this temporary Github repo

What happens if you do flatpak-builder --install (add --user to do a user install instead of system), then run it like a normal Flatpak?

If I install it, it works!

I never realized that I could install it so easily. Flatpak documentation says you can add a local repository to install it and I got an error when I tried it. The --install option seems much straightforward.

Do you know of any software “store” which ships development versions of Flatpak apps? (as Flathub provides only stable releases)
GNOME has the nightly repository, but the application I’m packaging is not part of GNOME.

Let me add one more question. It’s not clear to me what rename-icon should take as argument. The file only or the whole path? Source path or built path? Absolute or relative?

Flatpak documentation on renaming files seems to suggest I should use name only (not full path) of the source file (not build file).

In my case it would be just frescobaldi.svg (not the full path frescobaldi_app/icons/frescobaldi.svg). I’ve tried both but flatpak is searching within share/icons, while the application is building in share/icons/hicolor/scalable/apps. I’ve tried almost everything. I’m confused…

Here’s an error:

Renaming frescobaldi.desktop to org.frescobaldi.Frescobaldi.desktop
Error: icon frescobaldi.svg not found below /home/fede/src/flatpak/frescobaldi/.flatpak-builder/rofiles/rofiles-7LZxmt/files/share/icons

As you can see, rename-desktop-file is working fine (desktop file is in the root of repository).

For hosting, you can actually pretty easily self-host a Flatpak repo, and there’s also Flathub Beta for beta releases.

rename-icon takes just the name, without the extension.