0

I'm wondering how can I get android ndk version. I've installed ndk on my mac here: ~/Library/Android/sdk/ndk-bundle but it seems there is nothing capable to inform me about the version of this bundle.

By analyzing this script https://gist.github.com/jorgenpt/1961404 I've came to conclusion that there should be RELEASE.TXT file (since r5), however it doesn't exist...

source.properties seems to contain some useful info (like this: Pkg.Revision = 21.0.6113669 ), but how can I convert it to readable and meaningful values (r19c or r20b, for example)?

papirosnik
  • 311
  • 1
  • 3
  • 14

3 Answers3

1

A file call ndk-version.h lies in directory <ndk_directory>/25.1.8937393/toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/android/ndk-version.h, you can check the content for more information.

NDK version 25.1.8937393 (major.minor.build) is r25b.

For minor number 0,1,2..., it maps to letter a, b, c……. So 1 is b here.

#pragma once

/**
 * Set to 1 if this is an NDK, unset otherwise. See
 * https://android.googlesource.com/platform/bionic/+/master/docs/defines.md.
 */
#define __ANDROID_NDK__ 1

/**
 * Major version of this NDK.
 *
 * For example: 16 for r16.
 */
#define __NDK_MAJOR__ 25

/**
 * Minor version of this NDK.
 *
 * For example: 0 for r16 and 1 for r16b.
 */
#define __NDK_MINOR__ 1

/**
 * Set to 0 if this is a release build, or 1 for beta 1,
 * 2 for beta 2, and so on.
 */
#define __NDK_BETA__ 0

/**
 * Build number for this NDK.
 *
 * For a local development build of the NDK, this is -1.
 */
#define __NDK_BUILD__ 8937393

/**
 * Set to 1 if this is a canary build, 0 if not.
 */
#define __NDK_CANARY__ 0
KAlO2
  • 838
  • 11
  • 13
0

Taken from this SO question,

There's a source.properties file in the root of the NDK for r11 and newer.

Older versions had a RELEASE.TXT.

Credit goes to @Dan Albert

Community
  • 1
  • 1
tomerpacific
  • 4,704
  • 13
  • 34
  • 52
0

The version of your bundle is present on source.properties.

The value of Pkg.Revision is the actual number for release version.

In your case 21.0.6113669 means that you have Android NDK r21 (January 2020).

For more info about releases, check here https://developer.android.com/ndk/downloads/revision_history

therock24
  • 89
  • 3
  • I've already looked at that revision history (your link) and still have no idea what is the correspondence between revision number and version. In other words, how to convert .0.611369 into letter b, c, d, etc. How to understand either provided revision is LTS or Beta or something else. For instance, some 3rd party framework requires minimal version of ndk to be r19b. Does revision 19.X.YYYYYY meet this requirements? – papirosnik Feb 10 '20 at 13:42