After upgrading the Gradle plugin and Android Studio 4.2.1. I face this error while building the C++ library.
Caused by: com.android.builder.errors.EvalIssueException: NDK from ndk.dir at D:\Sdk\ndk\18.0.5002713 had version [18.0.x] which disagrees with android.ndkVersion [22.1.x]