Android NDK Support Version Limited
Asked Answered
G

2

7

I have used Android NDK for years, however, recently, I saw the message below when I built CPPs using ndk-build(ndk version 15)

Android NDK: android-9 is unsupported. Using minimum supported version android-14. Android NDK: WARNING: APP_PLATFORM android-14 is higher than android:minSdkVersion 9

Why does NDK stop supporting Android levels(3-13) lower than android-14?

I tried to find out why at NDK guides, https://developer.android.com/ndk/guides/stable_apis.html although I still have no idea. It seems NDK still supports higher than or equal to level 3.

I also guessed that one of flags or features I need in c++ may cause this. However, I could not even find any clue so far.

LOCAL_CPP_FEATURES := rtti exceptions
APP_CPPFLAGS += -std=c++11
APP_STL := gnustl_static

 

Gussy answered 15/8, 2017 at 1:20 Comment(1)
Gingerbread has incredibly few active devices, and supporting Gingerbread means things like libandroid_support need to include more and thus bloat APKs more. Alex and MM S both give good advice on how to handle this if you really want to continue supported Gingerbread.Shaylynn
R
3

Don't update NDK version 15 if your apps should run on android-9

According to NDK Revision History (https://developer.android.com/ndk/downloads/revision_history.html),

Android 2.3 (android-9) is no longer supported. The minimum API level target in the NDK is now Android 4.0 (android-9). If your APP_PLATFORM is set lower than android-14, android-14 is used instead.

Ruching answered 15/8, 2017 at 15:45 Comment(0)
E
3

Your question 'why' should be addressed to the NDK team. You can ask them at the public mail list or open a complaint at GitHub.

Anyways, for now their verdict is to stop supporting old devices. Expect next releases of NDK to cut the platform requirements further.

The interesting question is what you should do about this. If you care about android-9 much more than android-26, you can simply continue to use an older release of NDK. It won't just stop working. It doesn't have an expiration date.

Normally, Android preserves backwards compatibility: if an app was built for platform-X, it will run (maybe in compatibility mode) on platform-(X+n).

On the other hand, the new releases of NDK have important bug fixes, including security fixes. The new devices (e.g. platform 'O') may have problems running binaries compiled with old NDK. And definitely, the old NDK will not give you access to the new features that are only available on advanced platforms.

Therefore, it may be worthwhile to upload two different APKs - one, with target SDK=9, and another with min SDK=21 (your numbers may vary). Play Store allows maintaining separate APKs for different platforms (and ABIs). You should only be careful about version code policy, and then your users will receive their updates timely - those who are stuck with Eclair, and those who upgrade to Nougat.

Escobar answered 15/8, 2017 at 17:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.