Bug: 112382846

Clone this repo:
  1. 44beb13 [automerger skipped] Merge Android R am: ae27a0a500 -s ours am: 22c391f627 -s ours am: 75335b2489 -s ours am: a007ac4b54 -s ours by Xin Li · 6 months ago master android-s-preview-1
  2. 2e0fcad Update some dependencies. am: bc4edd149f am: d8ff296ba5 am: 5bb6e2ceb8 am: d403b58ca7 by Dan Albert · 6 months ago
  3. 8ad90d8 Improve documentation for the port API. am: a3fd28e936 am: af06c0b21e am: c2ee32b588 am: f48556b489 by Dan Albert · 6 months ago
  4. 9b9a25e Update OpenSSL to 1.1.1g. am: 07b1972462 am: f59149d305 am: c924853416 am: a124221de0 by Dan Albert · 6 months ago
  5. 6d1adf3 Update OpenSSL and curl. am: 734637fe66 am: 9e484637b9 am: cbbfee3aa0 am: 66273f5a2c by Dan Albert · 6 months ago


A collection of Android build scripts for various third-party libraries and the tooling to build them.

If you're an Android app developer looking to consume these libraries, this is probably not what you want. This project builds AARs to be published to Maven. You most likely want to use the AAR, not build it yourself.

Note: Gradle support for consuming these artifacts from an AAR is a work in progress.


Each third-party project is called a “port”. Ports consist of a description of where to fetch the source, apply any patches needed, build, install, and package the library into an AAR.

A port is a subclass of the abstract Kotlin class com.android.ndkports.Port. Projects define the name and version of the port, the URL to fetch source from, a list of modules (libraries) to build, and the build steps.

See the Port class for documentation on the port API.

Individual port files are kept in ports/$name/port.kts. For example, the cURL port is ports/curl/port.kts.

Building a Port

ndkports requires an NDK to be used for building to be specified on the command line as well as a list of packages to build. For example, to build cURL:

$ ./gradlew run --args='--ndk /path/to/android-ndk-r20 openssl curl'
Build output...
$ find  -name '*.aar'

Note that dependencies currently need to be already built or ordered explicitly.

To build all ports using Docker, use scripts/build.sh.