Conversation

So, I believe what is controlling this is -D ANDROID_NATIVE_API_LEVEL=26 , which is being passed to CMake (not clang) and is most likely being interpreted by the CMake toolchain file (script). Problem: If I set this to 21, I get this legitimate-looking error:
Image
1
I guess part of the problem is gradle/AndroidManifest.xml refer to these three things as minSdkVersion/targetSdkVersion/compileSdkVersion, CLANG refers to them as __ANDROID__API__/__ANDROID_API_FUTURE__/?, and CMake refers to them as ANDROID_NATIVE_API_LEVEL/?/?
2
ANDROID_NATIVE_API_LEVEL seems to be for minSdkVersion since minSdkVersion is the only one that's truly fixed at compile time. targetSdkVersion is essentially the max supported API level semantics, so if you have targetSdkVersion 30 and it's Android 10 then it's 29 at runtime.
1
Do you know what compileSdkVersion means in practice? If that determines the java toolchain you get when building with gradle-controlling-CMake, but I am getting the minSdkVersion java toolchain when using Cmake directly, that might explain the discrepancy
1
compileSdkVersion is the toolchain version and you're meant to always use the latest one. You should be ending up building everything (Java and native) with latest toolchain but with minSdkVersion set appropriately (__ANDROID_API__ for native) so it's backwards compatible.
1
You should probably still use compileSdkVersion 30 to have newer tools with a bunch of bug fixes and improvements but might as well leave targetSdkVersion at 26 if they don't make you deal with the newer restrictions and wouldn't be able to properly test higher than 26 anyway.
1
Show replies