Probably, using a "proper" NDK version is a better choice rather than stick to a too old NDK version. One of the advantages of using a "catching the time" NDK version is to adapt to the Android ABI changes as well as the improvements for compiler changes along with the Android API version evolvement. E.g.
- GCC is no longer supported. It is removed in NDK r18.
- Support for ARMv5 (armeabi), MIPS, and MIPS64 has been removed. Attempting to build any of these ABIs will result in an error since r17.
Also, there almost always be some bug fixes and security enhancement for each new revision. Personally I don't think there is much added value for sticking to an old version of NDK.
Is there any advantage to not updating the target NDK we build against
Maybe the advantage for not updating NDK version is to make your project be compatible with those historical devices which are going to disappear soon.
You can check the release notes for NDK to understand its evolvement.
https://developer.android.com/ndk/downloads/revision_history
For your concern about armeabi-v7a, here is how it officially said https://developer.android.com/ndk/guides/abis#v7a.
-- Edit --
To clarify a few things:
NDK revision: each revision usually add/remove features and supported platforms. Currently the latest revision is r18b. Compared to r16b, it removes platforms of android-14 and android-15.
minSdkVersion
: Set the minSdkVersion
property in the defaultConfig
or productFlavors
blocks of your module-level build.gradle
file. This makes sure your library is used only by apps installed on devices running an adequate version of Android.
ANDROID_PLATFORM
CMake variable: This variable is used to specify the name of the target Android platform. For example, android-18 specifies Android 4.3 (API level 18). You have TWO options to configure the android platform your are building for, one is this CMake variable, the other one is miniSdkVersion
. And also note that CMake has its own logic to choose the best platform version, NOT necessarily equal to the said minSdkVersion
.
- If there exists a platform version for the ABI equal to
minSdkVersion
, CMake uses that version.
- Otherwise, if there exists platform versions lower than
minSdkVersion
for the ABI, CMake uses the highest of those platform versions. This is a reasonable choice because a missing platform version typically means that there were no changes to the native platform APIs since the previous available version.
- Otherwise, CMake uses the next available platform version higher than
minSdkVersion
.
So, when you upgrade your NDK revision, and double check your required android platform exists in the NDK platforms directory, e.g. android-ndk-r16b/platforms
.
References: https://developer.android.com/ndk/guides/cmake