How to fix build error "CommandInvokationFailure: Grandle build failed. Problem with JDK

CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk-11.0.3\bin\java.exe -classpath “C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.2.1.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx2048m” “assembleRelease”


FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine java version from ‘11.0.3’.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I tried to install 12 JDK version, but it has some errors too(

I solved this problem with downloading JDK 12 and upgrading Unity to the latested version (version before was 2018.2.1f1);