Help Gradle build failing

I have a 2d game project which exports apk fine but gradle build fails. I just installed Android build template as per instructions and tried to build with gradle on it fails with this message.

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not open cp_settings generic class cache for settings file ‘/home/stark/Windows/Software/Godot_Projects/SimonClone/android/build/settings.gradle’ (/home/stark/.gradle/caches/8.2/scripts/4q30sfjl9o9m0vidtnj8l2d8l).

BUG! exception in phase ‘semantic analysis’ in source unit ‘BuildScript’ Unsupported class file major version 66

  • 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 351ms### Godot Version

Question

I’m also having the same issue.

If it’s the same bug as in the original post, as quoted above, it likely means your java sdk is unsupported by the current Gradle version.

In the case of the original post the major version refers to Java sdk version 22.

After some research I’ve figured out that if I delete the registry.bin file located at C:\Users\Username\.gradle\daemon\8.11.1, and run the Gradle build with OpenJDK 25, evrything works fine.