Flutter Could Not Find Tools. Jar

Flutter Could Not Find Tools. Jar

Hi today I've upgrade my MacBook to macOS Big Sur version 11.0.1. Now there is a problem coming out.

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

Anyone know how to solve this issue ? Thanks.

7 Answers

THREAD CLOSED

I'm a Mac user. I've found the solution by using this method.

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

Possible duplicate of .

You should not alter gradle.properties manually. Try setting your JAVA_HOME in ~/.bash_profile to something like-

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

then relaunch a terminal session or run

source ~/.bash_profile

If you are using Zsh/Oh-My-Zsh, add the above with file ~/.zshrc and then reload the same or relaunch the terminal-

source ~/.zshrc
1

I can't comment, but here's a macOS one-liner based on the other answers if you use ZSH (Catalina+ default). No need to install Java from Oracle.

echo 'export JAVA_HOME="/Applications/Android "' >> ~/.zshrc && source ~/.zshrc
2

Solution of u problem -> Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation

At last, here I found the solution.

I added jdk path

org.gradle.java.home=YOU_PATH_TO_JDK

to gradle.properties file and did a rebuild.

It works now.

2

This issue is Mac specific and reading online it appears that often after updating the OS this problem will happen.

I resolved this by removing the following internet plugin:

/Library/Internet Plug-Ins/JavaAppletPlugin.plugin

Strange that this is what did it, but it worked for me.

In my case I use FVM and use Flutter 2.2.3

For Intel Mac users

go to Android -> gradle.properties

and add following at end of the file

org.gradle.java.home=/Applications/Android 

like this

I was facing this issue and the simple solution that worked for me was:

  1. Did a clean installation of jdk8 in mac and add the path to environmental variables (JAVA_HOME).

    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Ho$
    
  2. Restarted the computer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.