Ionic + Cordova Android build error - could not find tools.jar

siti aishah ismail picture siti aishah ismail · Nov 16, 2020 · Viewed 7.9k times · Source

today I've upgrade my MacBook to macOS Big Sur version 11.0.1. Now there is a problem coming out when I tried to build the project for Android.

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

Answer

user3572565 picture user3572565 · Dec 9, 2020

Try running

/usr/libexec/java_home -V

And see if this shows in the list

/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

This was the case for me and I had to remove the entries to the Internet Plug-Ins folder. Check here for more details that helped me.