'gradle sync Error "cvc-complex-type.2.4.a:"

I have installed the latest android studio and I try to sync an old project that I download from GitHub and I get this Error:

cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{codename, tag}' is expected.

and This

CVC-complex-type.2.4.d: Invalid content was found starting with element 'base-extension'. No child element is expected at this point.


Solution 1:[1]

Set the NDK manually, and downgrade it to 21 or lower.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 johnnyb