0 votes

I'm running into trouble trying to export a project for Android. For some reason Godot keeps looking for Java in a location of an old JDK install from years ago which has since been deleted. I've updated my JAVA_HOME, reinstalled Java and Android Studio, double checked that the right packages are installed for Android Studio, but nothing helps. Godot refuses to acknowledge my updated JDK path.

I've already started discussing this in this thread:
https://godotforums.org/d/30269-cannot-export-for-android/7

I just tried again - I created a new project that contains one scene with a button and tried to build an AAB with it. I get the error

FAILURE: Build failed with an exception.

* What went wrong:
The supplied javaHome seems to be invalid. I cannot find the java executable. Tried location: C:\Program Files\Java\jdk1.8.0_151\bin\java.exe

* 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

Exit Code: 1

This is not what JAVA_HOME is

C:\Users\kitfox\.android>echo %JAVA_HOME%
C:\Program Files\Eclipse Adoptium\jdk-11.0.15.10-hotspot

I'm really not sure how to fix this. I was able to export for Android about two years ago, but nothing works after my latest round of upgrades.

Godot version v3.4.stable.mono.official [206ba70f4]
in Engine by (134 points)

My only guess is that something was messed up in your Windows registry.

I just searched the registry and there's nothing relevant with the string 'jdk' in it.

1 Answer

0 votes
Best answer

So it seems Gradle keeps its own registry. There was a file called ./gradle/daemon/7.2/registry.bin in my user directory that was caching the invalid jdk path and once I deleted it I was able to build.

by (134 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 Frequently asked questions and 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 [email protected] with your username.