I solved this problem by uninstalling some build-tools versions:
I had the following versions installed:
27.0.3
28.0.3
29.0.2
30.0.3
31.0.0-rc
I uninstalled the versions:
27.0.3
28.0.3
And then it was solved.
I did it by following this report:
https://github.com/godotengine/godot-docs/issues/4796
For this, go to the folder where you have the android SDK.
Look there for "sdkmanager.bat" and go to its folder.
Run cmd from that folder to locate the cmd console in that same folder where the "sdkmanager.bat" file is located.
From the console install or uninstall by following the link I left before.
Notice the commands he uses to install and uninstall build-tools versions but do it with his own versions (no need to put ".bat" if you have the cmd console located in the same folder as the "sdkmanager.bat" file)::
sdkmanager --uninstall "build-tools; 30.0.1"
sdkmanager --install "build-tools; 29.0.3"
To find out the versions of build-tools you have installed, go to the folder where you have the android SDK and then to "build-tools".