How to solve Flutter could not find tools.jar?

Hello Guys How Are You All ? Hope You All Are Fine. When I Update my MacBook to macOS Big Sur version 11.0.1. I am Faced Flutter could not find tools.jar Error in my mac. So here is all possible way to solve flutter could not find tools.jar.

Flutter could not find tools.jar

What is error

* What went wrong:
Execution failed for task ':apple_sign_in:compileDebugJavaWithJavac'.
> Could not find tools.jar. Please check that /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home contains a valid JDK installation.

I Think Some Problem with JDK path That’s Why facing This Error. So lets solve this error by all possible ways.

Solution 1:

  1. Go to your android folder > Gradle.properties > add your jdk path.
  1. Clean and rebuild then it is done.
// For Example Purpose Only
org.gradle.java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home

Solution 2

Problem Is the JAVA_HOME variable was not set (or Big Sur removed it somehow).

So we simply added it in my ~/.zshrc (or ~/.bashrc)- profiles

export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home

You can simply check and replace the version number in the above line.

Solution 3

At last, here I found the solution.

Add jdk path

org.gradle.java.home=YOU_PATH_TO_JDK

to gradle.properties file and did a rebuild.

This Will Also Solve Your error.

Here is GitHub Error #575

So, Guys all 3 solutions are worked for me. let me know in the comment section if it is worked for you as well.

Also Read

Milan Dhameliya is an Information Technology Engineer. By profession, he is a Full Stack developer with knowledge of multiple back-end platforms (e.g., PHP, Node.js, Python) and frontend Flutter frameworks.

1 thought on “How to solve Flutter could not find tools.jar?”

Leave a Comment