0
votes

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':firebase_core:compileDebugJavaWithJavac'.

Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_251 contains a valid JDK installation.

  • 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

enter image description here

enter image description here

After updating I started getting an error like this. Can anyone help?

1

1 Answers

0
votes

I had today the same issue, and at first I noticed that the error was about a JDK, while the path reported below was referring to a JRE (as in your screenshot above). I did some digging, and found out that I had multiple entries in PATH that led to a jre1.8.0_202, which in my case was the path indicated as wrong by gradle.

I fixed this by adding a JAVA_HOME environment variable that pointed to a java 8 JDK, since gradle looks for this variable first. I restarted Android Studio just to be cautious, and the problem was gone.

PS: I have no idea though on why the update caused this error. Not sure even was the update that caused it.