Creating a flatpak - Fontconfig error: Cannot load config file

I’m close to creating my first flatpak.
When my application runs, I get this error in the terminal:
Fontconfig error: Cannot load config file "/run/host/font-dirs.xml": No such file: /run/host/font-dirs.xml

Any ideas on how to prevent that error?

My flatpak’s json file is below:

{
    "app-id": "org.lvnauth.LVNAuth",
    "runtime": "org.freedesktop.Sdk",
    "runtime-version": "23.08",
    "sdk": "org.freedesktop.Sdk",
    "command": "/app/bin/startup.sh",
    "finish-args": [
	    "--socket=x11",
	    "--socket=fallback-x11",
	    "--share=network",
	    "--share=ipc",
	    "--socket=pulseaudio",
	    "--filesystem=home",
	    "--device=dri"
        ],
    "modules": [
        {
            "name": "lvnauth",
            "build-commands": [
		"install -D startup.sh /app/bin/startup.sh",
                "chmod +w /app/bin/startup.sh",
                "cp -r src/* ${FLATPAK_DEST}/bin"
	    ],
	    "buildsystem": "simple",
            "sources": [
                {
                    "type": "git",
                    "url": "https://github.com/jrezai/lvnauth.git",
                    "branch": "main"
                },
                {
                    "type": "file",
                    "path": "startup.sh"
                }
            ]
        },
	"python3-tkinter.json",
        {
            "name": "cpython",
            "sources": [
                {
                    "type": "archive",
                    "url": "https://www.python.org/ftp/python/3.11.2/Python-3.11.2.tar.xz",
                    "sha256": "29e4b8f5f1658542a8c13e2dd277358c9c48f2b2f7318652ef1675e402b9d2af"
                }
            ]
        },
        {
            "name": "flit-core",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"flit-core==3.9.0\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/c4/e6/c1ac50fe3eebb38a155155711e6e864e254ce4b6e17fe2429b4c4d5b9e80/flit_core-3.9.0.tar.gz",
                    "sha256": "72ad266176c4a3fcfab5f2930d76896059851240570ce9a98733b658cb786eba"
                }
            ]
        },
        {
            "name": "wheel",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"wheel==0.41.2\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/a4/99/78c4f3bd50619d772168bec6a0f34379b02c19c9cced0ed833ecd021fd0d/wheel-0.41.2.tar.gz",
                    "sha256": "0c5ac5ff2afb79ac23ab82bab027a0be7b5dbcf2e54dc50efe4bf507de1f7985"
                }
            ]
        },
        {
            "name": "python3-Pillow",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"Pillow==10.0.0\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/0f/8b/2ebaf9adcf4260c00f842154865f8730cf745906aa5dd499141fb6063e26/Pillow-10.0.0.tar.gz",
                    "sha256": "9c82b5b3e043c7af0d95792d0d20ccf68f61a1fec6b3530e718b688422727396"
                }
            ]
        },
        {
            "name": "python3-pygame-ce",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pygame-ce==2.3.1\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/29/1f/8acc9e552047358688875e7a1ef8f5b5419a7bc5c1eeee3a5beab5a995ff/pygame-ce-2.3.1.tar.gz",
                    "sha256": "d7eab24aa97ab806e1a3b3d268d0edb8ca3b7ee47f8baa6dbf29d46c39cf3d79"
                }
            ]
        },
        {
            "name": "python3-screeninfo",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"screeninfo==0.8.1\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/6e/bf/c5205d480307bef660e56544b9e3d7ff687da776abb30c9cb3f330887570/screeninfo-0.8.1-py3-none-any.whl",
                    "sha256": "e97d6b173856edcfa3bd282f81deb528188aff14b11ec3e195584e7641be733c"
                }
            ]
        },
        {
            "name": "python3-pygubu",
            "buildsystem": "simple",
            "build-commands": [
                "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pygubu==0.31\" --no-build-isolation"
            ],
            "sources": [
                {
                    "type": "file",
                    "url": "https://files.pythonhosted.org/packages/46/fd/b7cc00c8ea6d4d2867f6bb94bd2a1e6212f0ad529120666ac6e7b56ffc82/pygubu-0.31-py3-none-any.whl",
                    "sha256": "b8a177deee56a9686e2a9d2939f4af5e82b27c504bf51c79610d33a8c5b6a04d"
                }
            ]
        }
    ]
}

What version of flatpak are you using? That file was introduced in version 1.2.0 from 2019.

flatpak --version gives me 1.14.4 (I’m on Debian 12)

OK, that’s certainly new enough.

Do you see that message when running other flatpak apps? Does /run/host/font-dirs.xml in fact exist inside the sandbox?

flatpak run --command=sh org.lvnauth.LVNAuth

You can also check that with another app.

Another test would be to look at the output of flatpak run -vv. You should see something similar to:

F:     --ro-bind-data
F:     37
F:     /run/host/font-dirs.xml

I think I found a pattern.
Initially, I was testing my flatpak using:

flatpak run org.flatpak.Builder --run build-dir org.lvnauth.LVNAuth.json /app/bin/startup.sh

(which gave me a fontconfig error)

But when I use:

flatpak run org.lvnauth.LVNAuth

I no longer get the fontconfig error.
Thanks.