Gradle error when exporting Custom Build

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

i don’t have any module.
i don’t have any filename with contains space or “-”
but i keep notice error when exporting to android
this is a screenshoot of the error:

for google to find this:

FAILURE: Build failed with an exception

* What went wrong:
Gradle could not start your build.
> Could not create service of type GradleInternal using GradleModelProvider.createGradleModel().
   > Could not create an instance of type org.gradle.invocation.DefaultGradle.
   > Could not create an instance of type org.gradle.invocation.DefaultGradle.

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

Exit Code: 1
:bust_in_silhouette: Reply From: YASSINE

I think you messed the files in your JAVA_HOME directory, try the following :

Delete your JAVA_HOME directory then install a new openjdk build from here

Set the JAVA_HOME to the new openjdk directory then rebuild your project

Remember that the godot-3.5 android build needs openjdk 11 and not openjdk 1.8