Ndk

interface Ndk

DSL object for per-variant NDK settings, such as the ABI filter.

Summary

Public properties

MutableSet<String>

Specifies the Application Binary Interfaces (ABI) that Gradle should build outputs for and package with your APK.

String?

The C Flags

String?

The type of debug metadata which will be packaged in the app bundle.

Int?

Number of parallel threads to spawn.

MutableList<String>?

The LD Libs

String?

The module name

String?

The APP_STL value

Public properties

abiFilters

val abiFiltersMutableSet<String>

Specifies the Application Binary Interfaces (ABI) that Gradle should build outputs for and package with your APK.

You can list any subset of the ABIs the NDK supports, as shown below:

android {
// Similar to other properties in the defaultConfig block, you can override
// these properties for each product flavor in your build configuration.
defaultConfig {
ndk {
// Tells Gradle to build outputs for the following ABIs and package
// them into your APK.
abiFilters 'x86', 'x86_64', 'armeabi'
}
}
}

When this flag is not configured, Gradle builds and packages all available ABIs.

To reduce the size of your APK, consider configuring multiple APKs based on ABI—instead of creating one large APK with all versions of your native libraries, Gradle creates a separate APK for each ABI you want to support and only packages the files each ABI needs.

cFlags

var cFlagsString?

The C Flags

debugSymbolLevel

var debugSymbolLevelString?

The type of debug metadata which will be packaged in the app bundle.

Supported values are 'none' (default, no native debug metadata will be packaged), 'symbol_table' (only the symbol tables will be packaged), and 'full' (the debug info and symbol tables will be packaged).

Example usage:

android {
    buildTypes {
        release {
            ndk {
                debugSymbolLevel 'symbol_table'
            }
        }
    }
}

jobs

var jobsInt?

Number of parallel threads to spawn.

ldLibs

val ldLibsMutableList<String>?

The LD Libs

moduleName

var moduleNameString?

The module name

stl

var stlString?

The APP_STL value