CrystaX NDK 10


This is a distribution of the CrystaX NDK, which has been developed as a drop-in replacement for Google's Android NDK (Native Development Kit). Compared to Google's NDK, the CrystaX NDK provides the same functionality as well as several great features and tons of fixes and improvements.

The main goal of the CrystaX NDK is to allow Android developers to produce standard conformant code and thus make Android native development more efficient. The CrystaX NDK dramatically decreases development time allowing usage of standard code working on multiple platforms (iOS, OS X, Windows, Linux, etc.) instead of distracting developers with Android's peculiarities and forcing coders to try to workaround them (or even write separate Android-specific implementations of functionality already implemented for another platform if a detected problem cannot be easily worked around).

Unfortunately, Android libc (Bionic) has very limited functionality (which differs from one Android version to another), so developers have been forced to take into account all its peculiarities, detecting in run-time which specific Android version the application is running on and applying specific workarounds. With CrystaX NDK, developers can forget about such problems, since CrystaX NDK provides complementary libcrystax, which is used to hide such differences between Android versions or even re-implement many of libc functions. Most importantly, with the help of libcrystax, the application behaves the same on all Android devices regardless of Android version.

Another goal of CrystaX NDK is to make some great features available for the Android native world. For example, support of Objective-C and another programming languages.

This project was initially started as a personal project of Dmitry Moskalchuk with the intention to just add missing C++ support (C++ exceptions, RTTI, and the Standard C++ Library) to the Google's Android NDK, but with time, many additional needs were discovered, and it turned out that improving the CrystaX NDK step-by-step was in fact the best way to force an evolution of native Android development. Since its beginning in 2009, numerous open-source and commercial projects have used the CrystaX NDK for porting and development for Android with minimal effort.

Nowadays, CrystaX NDK offers numerous great features, making native development for Android easier. See below the key features of the CrystaX NDK.

  1. Full support of wide characters

    Wide characters are part of C and C++ languages and their standard libraries. For example, the C standard library provides functions allowing work with wide strings such as wcsnlen, wcsncasecmp, wcsncmp and others; the C++ standard library provides wchar_t specializations of standard C++ classes such as std::basic_string, std::basic_ostream, std::basic_regex etc. Unfortunately, Android libc (Bionic) either doesn't support wide characters at all or supports them in a very limited manner, depending on Android version.

    With the CrystaX NDK, you get fully standard-compliant wide characters support, including multibyte-to-wide and vice versa conversions. You can easily port existing code or write new code that uses wide characters, strings, streams, and regular expressions not distracting on Android's peculiarities.


  2. Full support of C locales

    Android libc (Bionic) has no native support of locales, so the only way to use localized input/output in native code is to implement localization in Java and refer to it through JNI. Obviously, such an approach adds significant run-time overhead, but it's the only choice if you're using Google's Android NDK.

    Now, with CrystaX NDK, locales are supported natively, so just set a locale with standard setlocale and all further C standard function calls will use that locale for input and output. CrystaX NDK also supports so-called "extended locales" (part of IEEE Std 1003.1, 2013 Edition), providing companion locale-enabled functions for many standard C interfaces, such as printf_l, strftime_l, strfmon_l and others.


  3. Full math support, including complex and type-generic math functions

    ISO C standard defines headers <tgmath.h> and <complex.h>. In Google's Android NDK, <complex.h> appears only starting from r10 and only for applications targeting Android 5.0 (android-21 platform), whereas type-generic math functions are not supported at all.

    With CrystaX NDK, you get fully working complex and type-generic math regardless of the target Android version. Nothing more to say - just use it as defined in ISO C standard and enjoy!

  4. The most recent toolchains

    The CrystaX NDK includes the most recent versions of GCC and Clang compilers. This allows developers to use new language abilities, such as new C++11/C++14 features. All compilers are built with high- and low-level optimizations, which enable generation of the most efficient code for target hardware.

  5. C++11/C++14 support

    Since the CrystaX NDK includes the most recent versions of GCC and Clang, it supports all C++11/C++14 features listed on C++11 Support in GCC, C++14 Support in GCC and C++ Support in Clang.

  6. Full C++ standard library

    In addition, the CrystaX NDK offers a fully working C++11 standard library, including classes std::thread and std::mutex, functions/classes from std::chrono, and functions std::stol, std::stoul etc. These classes and functions are not available (or available with restrictions) in the Google's Android NDK because of a lack of functionality in Android libc (Bionic).

    In the CrystaX NDK, we've taken care of the completeness of the C++ standard library and have fixed all such issues, so the full C++ standard library is available no matter which implementation you're using - GNU libstdc++ or LLVM libc++.

    By the way, LLVM libc++ in CrystaX NDK is a first-class citizen, the same as GNU libstdc++, so you're free to use either one of them, your choice. By default, GNU libstdc++ is used.


  7. Boost C++ libraries out of the box

    We provide prebuilt Boost C++ libraries (as well as header-only libraries) out of the box. Boost usage become as simple as can be. No need to build Boost libraries on your own anymore; no need to figure out what's wrong when it fails. Most important, Boost C++ libraries works much better with CrystaX NDK than the same libraries built by Google's NDK - because in CrystaX NDK they works on top of the much more standard-conformant base (yes, it's libcrystax, core of the CrystaX NDK).

    Here you can see an example of how to start using Boost C++ libraries in your Android project.

  8. Objective-C and Objective-C++ support

    The only languages Google's NDK supports are C and C++. CrystaX NDK adds support of Objective-C and Objective-C++ in addition to C and C++.

    Starting from CrystaX NDK 10.2.0, we've added support of Objective-C v2 runtime and initial frameworks (Foundation and CoreFoundation).

    Here you can see a simple example of how to use Objective-C for Android development. In two words, just add source files with the extension .m (Objective-C) or .mm (Objective-C++), specify them in LOCAL_SRC_FILES in and add "APP_OBJC := cocotron" in

  9. Tons of fixes and improvements of standard C library implementation

    It's a well-known fact that Android libc (Bionic) has many bugs in its implementation of standard C functions. For example, one of the most notorious bugs is strtod implementation, which works properly only for the simplest input string formats and fails for others required by ISO C Standard. Some of these bugs are fixed over time, others aren't. Anyway, even if some bugs are fixed, such fixes don't affect previously released Android versions, so developers are forced to live with them or implement their own workarounds. This significantly increases time for development or porting of native Android applications.

    In CrystaX NDK, we've implemented our own versions of such buggy functions in libcrystax and have done so without altering the typical development work flow. Compilers/linkers use libcrystax transparently for developers so one won't even know that a libcrystax implementation is being used instead of a Bionic (except for the fact that the behaviour has been fixed). Also, using CrystaX NDK, you'll never run into a situation where a bug fix is available only for specific Android versions. When we fix anything in libcrystax, we ensure it works on all Android versions.

  10. To be continued...

    If you don't see a great feature here, don't hesitate to contact us and ask for it. You can also use our issue/bug tracker to report bugs or feature requests. And, of course, your contributions are welcome!


We have plans for the further evolution of CrystaX NDK. We want to make it a comprehensive toolkit for native Android development, providing a solid basis for any POSIX-conforming software to be able run on Android without significant rewriting. To do that, we're asking for help from the community.

We've started a fundraising campaign on BountySource to continue the development of CrystaX NDK and keep it available free to all Android developers. We're asking everyone interested in the further evolution of native development for Android to help us. We would very much appreciate any kind of help - whether it is funding, contributions to the project by sending us patches, or helping to spread the news all over the world.

Please read more about CrystaX NDK’s history and our plans - and help us do that.


The content of the CrystaX NDK is covered by various open-source licenses. See the copyright disclaimers in each respective file for details.

Note that the CrystaX NDK release packages also contain prebuilt binaries for the compiler, linker, archiver, etc. The source codes for the toolchains are available at GitHub (you can use the build script to download it automatically).

The prebuilt GCC and companion binaries (GDB, binutils etc) are covered by either the GNU General Public License (GPL) or the GNU Lesser General Public License (LGPL). For details, see the files COPYING and COPYING.LIB under $NDK/toolchains/<toolchain>/prebuilt/<system>.

The prebuilt LLVM/Clang toolchains are covered by the LLVM "BSD" license.

Basically, licensing rules are the same as for Google's Android NDK - i.e., both commercial and non-commercial usage allowed. The only additions are regarding CrystaX parts, which are covered by a permissive BSD 2-clause license.


File Size SHA1
crystax-ndk-10.2.1-windows-x86.exe 801.862 MB 84a2ed549d016aa5c4cd6f7634f3f70daf951ae3
crystax-ndk-10.2.1-windows-x86_64.exe 879.869 MB 65c1d09ceb6c66327e9970a6e5b83e4ce3ab25a6
crystax-ndk-10.2.1-darwin-x86.7z 527.481 MB 9afe0c2e250dbff30caf709dcd75d40a9bdd7852
crystax-ndk-10.2.1-darwin-x86.tar.bz2 1.536 GB 65e8f122d62fa96f56725f687f560c7eaf249ab0
crystax-ndk-10.2.1-darwin-x86_64.7z 506.573 MB 16b2255ad0fcc9c677dbb377899b972dc37a8079
crystax-ndk-10.2.1-darwin-x86_64.tar.bz2 1.506 GB 1a58a84728f8f22a87b982b5ec41ec06fc966f57
crystax-ndk-10.2.1-linux-x86.7z 769.679 MB 8ba755c0bff2ae746b920f73f360c0f5eeade506
crystax-ndk-10.2.1-linux-x86.tar.bz2 1.920 GB 710fbc392a926a5422b68b73428b91d95cd9bdb7
crystax-ndk-10.2.1-linux-x86_64.7z 818.478 MB ad4e589bcc720a4fd502b4cf9eef982be8823367
crystax-ndk-10.2.1-linux-x86_64.tar.bz2 1.940 GB a3ae48f0b824e9e87f511ccdf87f0dda1fc2d65b

How to build

You can also build the distribution from sources if you don't want to use the prebuilt versions for some reason. Follow the instructions below.

Setting up the build environment:

Follow the instructions from the AOSP site (except the Java part):

WARNING!!! Building the Windows version of CrystaX NDK is only supported on a Linux host (cross-build used). Building on a Windows host is not tested and not supported.

Building NDK

  • Download the build script and run it.
    \curl -sSL | /bin/bash
    It will take a long time - up to many hours. When the script is finished, it will print the directory containing the package with the NDK release.
  • You're done! Use this package as a drop-in replacement for Google's NDK!