How to find the ndk revision number for your android setup
Asked Answered
M

4

41

Is there a means to find the ndk revision number ideally from the cmd line or from within android studio?

My use case is android studio has run an update, replaced ndk-bundle with the latest version and I want to be able to find out what revision no. that is. i.e. r10d, r11a etc.

UPDATE

~/Android/Sdk/ndk-bundle/CHANGELOG.md looks like this - I can't see an explicit reference to the revision number, can you? maybe its just 11 but they usually have a letter as well?

Changelog
=========

Report issues to [GitHub].

[GitHub]: https://github.com/android-ndk/ndk/issues

NDK
---
 * Removed all sysroots for pre-GB platform levels. We dropped support for them
   in r11, but neglected to actually remove them.
 * Exception handling when using `c++_shared` on ARM32 now mostly works (see
   [Known Issues](#known-issues)). The unwinder will now be linked into each
   linked object rather than into libc++ itself.
 * Default compiler flags have been pruned:
   https://github.com/android-ndk/ndk/issues/27.
     * Full changes here: https://android-review.googlesource.com/#/c/207721/5.
 * `-fno-limit-debug-info` has been enabled by default for Clang debug builds.
   This should improve debugability with LLDB.
 * `--build-id` is now enabled by default.
     * This will be shown in native crash reports so you can easily identify
       which version of your code was running.
 * `NDK_USE_CYGPATH` should no longer cause problems with libgcc:
   http://b.android.com/195486.
 * `-Wl,--warn-shared-textrel` and`-Wl,--fatal-warnings` are now enabled by
   default. If you have shared text relocations, your app will not load on
   Marshmallow or later (and have never been allowed for 64-bit apps).
 * Precompiled headers should work better:
   https://github.com/android-ndk/ndk/issues/14 and
   https://github.com/android-ndk/ndk/issues/16.

Clang
-----

 * Clang has been updated to 3.8svn (r256229, build 2690385).
     * Note that Clang packaged in the Windows 64 NDK is actually 32-bit.
 * `__thread` should work for real this time.

GCC
---

 * Synchronized with the ChromeOS GCC @ `google/gcc-4_9` r227810.
 * Backported coverage sanitizer patch from ToT (r231296).
 * Fixed libatomic to not use ifuncs:
   https://github.com/android-ndk/ndk/issues/31.

Binutils
--------

 * "Erratum 843419 found and fixed" info messages are silenced.
 * Introduced option '--long-plt' to fix internal linker error when linking huge
   arm32 binaries.
 * Fixed wrong run time stubs for AArch64. This was causing jump addresses to be
   calculated incorrectly for very large DSOs.
 * Introduced default option '--no-apply-dynamic' to work around a dynamic
   linker bug for earlier Android releases.
 * NDK r11 KI for `dynamic_cast` not working with Clang, x86, `stlport_static`
   and optimization has been fixed.

GDB
---

 * Updated to GDB 7.11: https://www.gnu.org/software/gdb/news/.

Known Issues
------------

 * This is not intended to be a comprehensive list of all outstanding bugs.
 * x86 ASAN still does work. See discussion on
   https://android-review.googlesource.com/#/c/186276/
 * Exception unwinding with `c++_shared` still does not work for ARM on
   Gingerbread or Ice Cream Sandwich.
 * Bionic headers and libraries for Marshmallow and N are not yet exposed
   despite the presence of android-24. Those platforms are still the Lollipop
   headers and libraries (not a regression from r11).
 * RenderScript tools are not present (not a regression from r11):
   https://github.com/android-ndk/ndk/issues/7.
 * r12 will most likely not work with Android Studio/Gradle right away. The
   Gradle plugin will need to be updated to match the build changes we made in
   `ndk-build`.
 * We've regressed on http://b.android.com/41770.
Muscatel answered 14/4, 2016 at 12:51 Comment(0)
L
62

There's a source.properties file in the root of the NDK for r11 and newer. Older versions had a RELEASE.TXT.

Lawson answered 29/4, 2016 at 23:24 Comment(1)
Nice find. This should be helpful for selecting the right c++ runtime library.Twofold
P
14

In Android Studio version 4.1.1, I can find the installed NDK version from the menu. Go to Tools->SDK Manager(or Files->Settings->Appearance & Behavior->System Settings->Android SDK). Then select the SDK Tools tab, and check the Show Package Details checkbox. You will see your NDK version.

enter image description here

Plasia answered 16/1, 2021 at 8:39 Comment(1)
But, which one will be used as two ndk is installed in the posted image? Thanks.Numerology
P
9

I got the same problem when I was trying to build this version of boost and use the following line to retrieve my NDK version.

version=$(sed -En -e 's/^Pkg.Revision\s*=\s*([0-9a-f]+)/r\1/p' $source_properties)

Where source_properties=$AndroidNDKRoot"/source.properties" at the root of your NDK folder.

Placencia answered 3/4, 2017 at 10:35 Comment(1)
Returns nothing in my case. So I use cat $source_properties | grep Pkg.Revision | sed 's|.*= ||' which returns 20.1.5948944Ayannaaycock
T
0

On my setup:

Android Studio Hedgehog | 2023.1.1

Android NDK 21 something and 25 something installed.


I set the project tree to show "Project Files".

Then navigate to:

app.cxx\tools\debug\armeabi-v7a\compile_commands.json

It shows plenty of compile info related to the NDK version. For me it was 25 something.

Thomism answered 3/12, 2023 at 10:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.