Solution version: gradle is mandatory to specify the ndk version. Specifically specify which version of ndk, you can directly specify the version suggested by the error prompt according to the error message.
android { ndkVersion '22.1.7171670' ....... }
Error message: No version of NDK matched the requested version 21.0.6113669. Versions available locally: 22.1.7171670