But my older setup (with older jni folder)
and using 5.1.1, NDK 21.0.6113669, and Android API 30 is working a dream...and creating well-running apks

My SDK is installed to c:\Android\android-sdk\
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
Why do you need to mess with those other settings at all, when install and compiling is working using older gradle?

My working setupAndroid Studio 3.5.3
Build #AI-191.8026.42.35.6010548, built on November 15, 2019
JRE: 1.8.0_202-release-1483-b03 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
For me the issues I got we just bugs in the newer jni src files - not with setup...even then, it looks like a small missing include file issue?
But just thought I would let you know Android is not broken - it can be fixed if the setup is right and the jni files are right...

Happy to provide more info if you need it on my setup...