How to fix jlink executable /app/jre/bin/jlink does not exist in Godot?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Legalas61

Godot creates apk, but problem with creating AAB.

Error:

 Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 32

This Android Gradle plugin (7.0.3) was tested up to compileSdk = 31

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=32
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 32
> Task :preBuild UP-TO-DATE
> Task :preDebugBuild UP-TO-DATE
> Task :assetPacks:installTime:generateAssetPackManifest UP-TO-DATE
> Task :processDebugAssetPackManifests UP-TO-DATE
> Task :linkDebugManifestForAssetPacks UP-TO-DATE
> Task :assetPackDebugPreBundleTask UP-TO-DATE
> Task :compileDebugRenderscript NO-SOURCE
> Task :generateDebugResValues UP-TO-DATE
> Task :generateDebugResources UP-TO-DATE
> Task :mergeDebugResources UP-TO-DATE
> Task :createDebugCompatibleScreenManifests UP-TO-DATE
> Task :extractDeepLinksDebug UP-TO-DATE
> Task :processDebugMainManifest UP-TO-DATE
> Task :processDebugManifest UP-TO-DATE
> Task :processApplicationManifestDebugForBundle UP-TO-DATE
> Task :bundleDebugResources UP-TO-DATE
> Task :mergeDebugShaders UP-TO-DATE
> Task :compileDebugShaders NO-SOURCE
> Task :generateDebugAssets UP-TO-DATE
> Task :mergeDebugAssets UP-TO-DATE
> Task :compileDebugAidl NO-SOURCE
> Task :generateDebugBuildConfig UP-TO-DATE
> Task :checkDebugAarMetadata UP-TO-DATE
> Task :processDebugManifestForPackage UP-TO-DATE
> Task :processDebugResources UP-TO-DATE
> Task :compileDebugKotlin UP-TO-DATE
> Task :processDebugJavaRes NO-SOURCE
> Task :mergeDebugJavaResource UP-TO-DATE
> Task :checkDebugDuplicateClasses UP-TO-DATE
> Task :javaPreCompileDebug UP-TO-DATE
> Task :compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: /home/username/Android/Sdk/platforms/android-32/core-for-system-modules.jar.
         > jlink executable /app/jre/bin/jlink does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
23 actionable tasks: 1 executed, 22 up-to-date

Exit Code: 1

Where the /app/jre/bin/jlink path comes from ? /usr/lib/jvm/java-jdk-19.0.1/bin have file jlink

i`m use

  • java version “19.0.1” 2022-10-18
  • Java™ SE Runtime Environment (build 19.0.1+10-21)
  • Java HotSpot™ 64-Bit Server VM (build 19.0.1+10-21, mixed mode, sharing)
:bust_in_silhouette: Reply From: ywmaa

I had the same problem, for me it was because I installed Godot Engine using flatpak, this probably happens because flatpak sandboxes its apps.

so installing Godot from godotengine.org will work.