I have install Flutter and set up Android SDK. But know I am facing this issue.
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 FilesJavajdk-20binjava.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
Exception: Gradle task assembleDebug failed with exit code 1
When I looked for the solutions online, all the videos gave the solution to delete jre folder in Android Studio. But I don’t have it and I use only VS Code. Please help me out with a step by step solution.enter image description here
2
Answers
Check your environmental variables. You seem to have set the wrong path to your JAVA_HOME Variable. Try updating the path to your JDK root folder.
This should fix the issue
Use the following settings in vscode to specify the jdk path.