On 04.12.2017 at 11:06 Alex Cohn wrote:
> The short answer is "NO". NDK r16 drops support for android-9, android-12, and android-13.
> You can download an archive of NDK r15 to target android-9 till 13,
> or r10 that supports platforms from android-3 till 21.
> The differences are not only extra APIs (like OpenMAX) or more
> functions in libc (like pread64), but also amy involve subtle
> compiler and linker flags, so I would not recommend to use the new
> toolchains for platforms where they were not tested.
> Unfortunately, given the variety of Android devices, there are
> enough platform bugs and incompatibilities even if you use the
> standard tools, and older devices often have their very special
> quirks. I believe that (except for MIUI) the level of compliance of
> modern ROMs is better than it was 7 years ago.
Thanks for the answer!
This makes me wonder of course why there isn't an error message when
trying to build an NDK project with the following build.gradle:
android {
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig {
applicationId 'com.foo.bar'
minSdkVersion 9
targetSdkVersion 9
versionCode 10
versionName "1.0"
externalNativeBuild {
cmake {
arguments '-DANDROID_PLATFORM=android-9',
'-DANDROID_TOOLCHAIN=clang'
}
}
}
This compiles just fine although the resulting APK probably won't
work on Gingerbread any longer. I think Gradle should throw an error
here and tell me that I can't build for android-9 with the current
NDK any more. But it doesn't say anything. Instead it just builds
the APK without any error messages whatsoever .... and I have no
idea what the APKs minimum API will be now that android-9 is no
longer available. Had I not noticed by accident that android-9 is
no longer part of the latest NDK, I wouldn't have noticed anything...
very bad!