As of 2019, Google introduced a new NDK "side-by-side" feature which allows you to install multiple NDK versions under the Android SDK directory. All new NDK versions are downloaded to the side-by-side directory and it replaces the old "ndk-bundle" directory.
The folder structure appear as follows on macOS...
There will be an "ndk" directory under the "Android/sdk" directory. Each subdirectory under "ndk" will be the version number of the installed NDK.
Before the NDK side-by-side feature existed, Android Studio used to install the NDK under the Android SDK directory as shown below. Updating the NDK version used to replace the old version. Android Studio no longer installs to this directory.
To be done:
The CLI should search for the installed NDK directory in the following order.
- The "ANDROID_NDK" environment variable, if set.
- The newest NDK side-by-side version subdirectory, if available.
- The "ndk-bundle" directory.