How to export Android build ? Please, help me

Godot Version

4.5.1. Stable

Question

Please, help me to fix the issue, how to export Android build?

What should I do?

WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by net.rubygrapefruit.platform.internal.NativeLibraryLoader in an unnamed module (file:/C:/Users/StarW/.gradle/wrapper/dists/gradle-8.11.1-bin/bpt9gzteqjrbo1mjrsomdt32c/gradle-8.11.1/lib/native-platform-0.22-milestone-26.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
BUG! exception in phase ‘semantic analysis’ in source unit ‘_BuildScript_’ Unsupported class file major version 69

Unsupported class file major version 69

* 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 11s

Exit Code: 1

1 Like

Yep, I got the same error…

Here’s a good tutorial: https://youtu.be/dCLYMF32ZBE

Hopefully if you do what this says it will work.

This took me a minute to figure out but I just got it working with Godot 4.6.

Unsupported class file major version 69

That error means your JDK version and Gradle version are incompatible.
You will need to make sure your JDK version and Gradle version are compatible.

The Gradle version is hard coded in a Gradle wrapper properties file which is created when you click “Install Android Build Template…”

To fix this:

Find your JDK version and compatible Gradle version:

  1. Find your JDK version by entering java -version at a command prompt
  2. Find the compatible Gradle version in their compatibility matrix

In this case, my JDK version was 25.0.1 and the compatible Gradle version is 9.1.0. Yours will be the same if you see “major version 69” in that error.

To change your Gradle version:

  1. Edit the Gradle version on the distributionUrl line of your Android build template’s Gradle wrapper properties at res://android/build/gradle/wrapper/gradle-wrapper.properties (you can open this file in any text editor):
#Wed Jan 17 12:08:26 PST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

This will make Godot download the updated Gradle version when exporting your project.

Also I just realized Godot recommends using JDK 17. So if you’re using JDK 17, it should probably just work.

1 Like