Android SDK is missing build-tools

I DOWNLOADED unity 2020.1.17f from unity Hub 2.4.2 and install all Tools(SDK,JDk,NDK) etc…
but when I’m going to build my I’m getting this error

UnityException: Android SDK is missing build-tools. Android SDK Build-tools component is not found. Make sure all tools are installed in the SDK manager.

i don’t know to fix this i tried to a lot but nothing good please help

i got same problem today

for everyone who will get this page looking for answer, FIX:

1)Open Unity HUB

  1. open Installs

  2. open your Unity Version via Add modules(EVEN if you installed JDK,NDK,SDK etc)

In my case even if all checkboxes near JDK,NDK were gray (as i have installed them), i saw active button
“Done” and required empty space on disk ~ 150mb. Looks like hub downloads all needed files or
something like this.

  1. Then reload unity editor (without reload same error)

  2. Done

Restarting unity fixed the issue for me.

open sdkmanager and add build-tools (most probably the latest one)

I had a similar problem, searched all the forums, nothing helped.

In the end, I solved it by installing JDK 8, setting JAVA_HOME in Environment Variables, and the path to install JDK.
And also downloaded the latest Unity Hub 3.0.1 and installed Unity from it.
After that, everything worked.

Not sure what helped exactly, the latest Unity Hub or adding JAVA to Environment Variables…

For me, the installation of the Unity Install did not install correctly, even though it said it was successful.

The folder C:\Program Files\Unity\Hub\Editor\2022.2.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools was missing It was present for the other Installs in the equivalent directory.

I uninstalled 2022.2.9f1 and reinstalled it and it worked.

With Unity 2021.3 I had to manually merge some of the SDK tools from the Unity installation into the custom SDK location (created with Android Studio). This took a lot of trial and error, during which you have to try restarting Unity and toggling on/off the SDK path option in Edit > Preferences > External Tools.

There is a file in ../Hub/Editor/Your-editor-version/modules.json - it has information about modules that installed in the editor include the download link and extracted path.

What i did is download the Command Line Tools from the link and extract it to the directory "extractedPathRename" mentioned in the modules.json.