Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 185 commits ahead, 244 commits behind moritz-wundke:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Build and/or simply download the Boost C++ Libraries for the Android platform, with Google's Ndk.

The Boost C++ Libraries, are possibly the most popular and generally useful c++ libraries. It would be nice to be able to use them when developing (native c++ or hybrid java/c++ with Google's Ndk) apps and/or libraries for Android devices. The Boost libraries are written to be cross platform, and are available in source code format. However, building the libraries for a given target platform like Android can be very difficult and time consuming. (In particular, building arm64_v8a shared libraries that an application can actually load). This project aims to lower the barrier by offering a simple customizable build script you can use to build Boost for Android (abstracting away all the details of the underlying custom boost build system, and target architecture differences), and even providing standard prebuilt binaries to get you started fast.

Tested with Boost 1.79.0 and Google's Ndk 25 (LTS).

You can build directly on a Linux or MacOS machine, or indirectly on any of Linux, Windows, MacOS via docker (or of course virtual machines). No matter what OS you use to build with, the resulting binaries can then be copied to any other, and used from then on as if you had built them there to start with (theyre cross compiled for android and have no memory of where they were built).

Works with clang (llvm) - as of ndk 16 google no longer supports gcc.

Creates binaries for multiple abis (armeabi-v7a, arm64-v8a, x86, x86_64).

Tested on a development machine running Ubuntu 20.04 and MacOS 11.6.5


You can just download a current set of standard prebuilt binaries here if you don't need to customize the build, or don't have access to a unix-like development machine.

Build Yourself

Build using Docker

The easiest and most flexible way to build is to use docker. This way you need not need to install any build tools or other prerequisites, and can use any host operating system you wish that has docker installed.

See docker_readme for instructions.

Build directly on your Linux or MacOS machine

  • For prerequisites see Dockerflile (even though the remaining instructions below don't use docker)

  • Download the boost source and extract to a directory of the form ..../major.minor.patch eg /home/declan/Documents/zone/mid/lib/boost/1.71.0 If necessary, fix any bugs in boost (eg for 1.71.0).

    Note: After the extarction ..../boost/1.71.0 should then be the direct parent dir of "", "boost-build.jam" etc

> ls /home/declan/Documents/zone/mid/lib/boost/1.71.0
boost  boost-build.jam  boostcpp.jam  boost.css  boost.png  ....
  • Clone this repo:
> git clone ./boost_for_android
  • Modify the paths (where the ndk is) and variables (which abis you want to build for) in, and execute it. If the build succeeds then the boost binaries should then be available in the dir boost_for_android/build
> cd boost_for_android
> ./
  • Note: If for some reason the build fails you may want to manually clear the /tmp/ndk-your_username dir (which gets cleared automatically after a successful build).

Test App

Also included is a test app which can be opened by Android Studio. If you build and run this app it should show the date and time as calculated by boost chrono (indicating that you have built, linked to and called the boost library correctly), as well as the ndk version used to build the boost library. To use the test app make sure to adjust the values in the file.

Note: The test app uses CMake for Android

Header-only Boost Libraries

Many of the boost libraries (eg. algorithm) can be used as "header only" ie do not require compilation . So you may get away with not building boost if you only want to use these. To see which of the libraries do require building you can switch to the dir where you extracted the boost download and call:

> ./ --show-libraries 

which for example with boost 1.79 produces the output:

The following Boost libraries have portions that require a separate build
and installation step. Any library not listed here can be used by including
the headers only.

The Boost libraries requiring separate building and installation are:
    - atomic
    - chrono
    - container
    - context
    - contract
    - coroutine
    - date_time
    - exception
    - fiber
    - filesystem
    - graph
    - graph_parallel
    - headers
    - iostreams
    - json
    - locale
    - log
    - math
    - mpi
    - nowide
    - program_options
    - python
    - random
    - regex
    - serialization
    - stacktrace
    - system
    - test
    - thread
    - timer
    - type_erasure
    - wave


Crystax is an excellent alternative to Google's Ndk. It ships with prebuilt boost binaries, and dedicated build scripts. These binaries will however not work with Goolge's Ndk. If for some reason you can't or don't want to use Crystax then you can't use their boost binaries or build scripts, which is why this project exists.


  • Many thanks to crystax for their version of which I adapted to make it work with the google ndk.
  • Thanks to google for the files,,


Android port of Boost C++ Libraries







No packages published


  • Shell 69.1%
  • Java 16.9%
  • C++ 7.5%
  • CMake 6.5%