Build problems with HelloTemplate flatpak packaging on Ubuntu 24.10 #3

Closed
opened 2025-04-08 22:02:52 +02:00 by mrlem · 3 comments
mrlem commented 2025-04-08 22:02:52 +02:00 (Migrated from github.com)

Hi,

First, thanks a lot for Java GI and those examples!

Focusing on the HelloTemplate example, I'm experiencing some issues with the flatpak packaging. I'm quite new to flatpak, so I might miss obvious elements.

So far:

  • I managed to run the app using the gradle run task without any issue 👍
  • I managed to build the flatpak... with some manipulations that were not mentioned in the doc (but might have been obvious to someone more familiar with flatpak):
    • missing packages: I had install the following first, using flatpak --user install:
      • org.gnome.Platform//45
      • org.gnome.Sdk//45
      • org.freedesktop.Sdk.Extension.openjdk//23.08
    • flatpak-builder was failing on gradle installDist, complaining that there were no JDK, so in flatpak/my.example.HelloTemplate.json, I:
      • changed build commands to "build-commands" : [ "/usr/lib/sdk/openjdk/installjdk.sh", "gradle installDist" ],
      • changed append-path to "append-path": "/usr/lib/sdk/openjdk/gradle/bin:/app/jre/bin"

This got me to a point where the flatpak is built and installed, but now whenever I try to run it, there's a 20-30s lag before the actual program gets executed (it runs fine aside from this). While it is stuck, the last line displayed is:

  • F: Running 'bwrap --args 38 -- xdg-dbus-proxy --args=41'

Not sure how to resolve that. Not even sure this is related to the HelloTemplate sample, and not some flatpak issue.

Hi, First, thanks a lot for Java GI and those examples! Focusing on the HelloTemplate example, I'm experiencing some issues with the flatpak packaging. I'm quite new to flatpak, so I might miss obvious elements. So far: * I managed to run the app using the gradle run task without any issue 👍 * I managed to build the flatpak... with some manipulations that were not mentioned in the doc (but might have been obvious to someone more familiar with flatpak): - missing packages: I had install the following first, using `flatpak --user install`: * `org.gnome.Platform//45` * `org.gnome.Sdk//45` * `org.freedesktop.Sdk.Extension.openjdk//23.08` - flatpak-builder was failing on gradle installDist, complaining that there were no JDK, so in flatpak/my.example.HelloTemplate.json, I: * changed build commands to `"build-commands" : [ "/usr/lib/sdk/openjdk/installjdk.sh", "gradle installDist" ],` * changed append-path to `"append-path": "/usr/lib/sdk/openjdk/gradle/bin:/app/jre/bin"` This got me to a point where the flatpak is built and installed, but now whenever I try to run it, there's a 20-30s lag before the actual program gets executed (it runs fine aside from this). While it is stuck, the last line displayed is: * `F: Running 'bwrap --args 38 -- xdg-dbus-proxy --args=41'` Not sure how to resolve that. Not even sure this is related to the HelloTemplate sample, and not some flatpak issue.
jwharm commented 2025-04-10 20:14:21 +02:00 (Migrated from github.com)

Hi, thanks for the bug report!

I'll add the missing packages to the README.md.

The gradle installDist used to work, and I'm not sure why it's now broken. I tried to apply the changes as you described, but it still doesn't work. Can you please create a PR for your changes in flatpak/my.example.HelloTemplate.json, or paste the full file contents?

Regarding the 30 second lag, could it be this issue? https://github.com/flatpak/flatpak/issues/4394

Hi, thanks for the bug report! I'll add the missing packages to the README.md. The `gradle installDist` used to work, and I'm not sure why it's now broken. I tried to apply the changes as you described, but it still doesn't work. Can you please create a PR for your changes in `flatpak/my.example.HelloTemplate.json`, or paste the full file contents? Regarding the 30 second lag, could it be this issue? https://github.com/flatpak/flatpak/issues/4394
mrlem commented 2025-04-10 21:27:15 +02:00 (Migrated from github.com)

Thanks a lot @jwharm for taking the time to look into that issue, and for the commit.
I have created #4 with the modifications I have done here in the flatpak descriptor.
Tested after clearing my user flatpak repo and .flatpak-builder work directory.

If you still experience an issue with this, feel free to provide an error message, I might have forgotten another prerequisite while investigating my issue.

Thanks a lot @jwharm for taking the time to look into that issue, and for the commit. I have created #4 with the modifications I have done here in the flatpak descriptor. Tested after clearing my user flatpak repo and .flatpak-builder work directory. If you still experience an issue with this, feel free to provide an error message, I might have forgotten another prerequisite while investigating my issue.
jwharm commented 2025-04-12 10:53:26 +02:00 (Migrated from github.com)

Thanks for the PR!
I've done some further changes to the manifest, and eventually managed to avoid the installation of the JDK, so now only the JRE is included with the installed application.
I also updated the runtimes to GNOME 47 and JDK 23.

Thanks for the PR! I've done some further changes to the manifest, and eventually managed to avoid the installation of the JDK, so now only the JRE is included with the installed application. I also updated the runtimes to GNOME 47 and JDK 23.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
java-gi/examples#3
No description provided.