0 votes

Hi all.

I've been attempting to find what caused exporting to Android to not work in 3.2-stable. So far, I've hit an error with compiling export templates, where Gradle says it "Could not determine java version from '13.0.1'"

The command I was using was ./gradlew generateGodotTemplates

The full output below;

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine java version from '13.0.1'.

  • 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

in Engine by (197 points)

1 Answer

0 votes

Sounds like your Java version is not set properly. I assume you're on a unix machine. You can see which versions you have installed:

/usr/libexec/java_home -V

Mine (Mac) yields this:

Matching Java Virtual Machines (1):
    11.0.7, x86_64: "Java SE 11.0.7"    /Library/Java/JavaVirtualMachines/jdk-11.0.7.jdk/Contents/Home

Since I have "11.0.07" set, I set my JAVA_HOME variable to:

export JAVA_HOME=`/usr/libexec/java_home -v 11.0.7`

That will work in your current command line session. You can add it to your .bash_profile, .profile, or .zshrc (depending on your shell) to persist between command line sessions.

You can check the Java version you're currently using with javac -version and if those are not working, Java isn't installed correctly. That should solve your issue with Gradle as it uses the Java compiler. But I found that version 13 does not work and I had to install version 11 to get it to compile correctly.

I came across this question while searching for something different and I got this working after a lot of trouble myself, so I figured I'd leave an answer here if anyone else stumbled across this question like I did.

by (22 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.