I tried every solution I can think about, but it still not working.
I'm getting this error while running my app.
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\Android\Android Studio\jre\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 Exception: Gradle task assembleDebug failed with exit code 1
CodePudding user response:
- add java to system environment variable.
- restart your IDE
if it doesn't work
- try to run after restarting your PC.
CodePudding user response:
Go To the android studio directory (Default C:\Program Files\Android\Android Studio) remove the JRE folder run cmd as administrator
cd C:\Program Files\Android\Android Studio mklink /D "jre" "jbr" - REF.
CodePudding user response:
I have faced the same problem, you have to do as what income in these posts:
2- This to return every thing to the normal
after that every thing will be ok, I've done all of that since a while today.