Stay organized with collections
Save and categorize content based on your preferences.
Ndk
@Incubating 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 abiFilters: MutableSet<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.
debugSymbolLevel
var debugSymbolLevel: String?
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 jobs: Int?
Number of parallel threads to spawn.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# Ndk\n===\n\n\n```\n@Incubating interface Ndk\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nDSL object for per-variant NDK settings, such as the ABI filter.\n\nSummary\n-------\n\n| ### Public properties ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e` | [abiFilters](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/Ndk#abiFilters()) Specifies the Application Binary Interfaces (ABI) that Gradle should build outputs for and package with your APK. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [cFlags](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/Ndk#cFlags()) The C Flags |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [debugSymbolLevel](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/Ndk#debugSymbolLevel()) The type of debug metadata which will be packaged in the app bundle. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`?` | [jobs](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/Ndk#jobs()) Number of parallel threads to spawn. |\n| [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)`\u003c`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`\u003e?` | [ldLibs](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/Ndk#ldLibs()) The LD Libs |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [moduleName](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/Ndk#moduleName()) The module name |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` | [stl](/reference/tools/gradle-api/7.3/com/android/build/api/dsl/Ndk#stl()) The APP_STL value |\n\nPublic properties\n-----------------\n\n### abiFilters\n\n```\nval abiFilters: MutableSet\u003cString\u003e\n```\n\nSpecifies the Application Binary Interfaces (ABI) that Gradle should build outputs for and package with your APK.\n\nYou can list any subset of the [ABIs the NDK supports](https://developer.android.com/ndk/guides/abis.html#sa), as shown below: \n\n```carbon\nandroid {\n // Similar to other properties in the defaultConfig block, you can override\n // these properties for each product flavor in your build configuration.\n defaultConfig {\n ndk {\n // Tells Gradle to build outputs for the following ABIs and package\n // them into your APK.\n abiFilters 'x86', 'x86_64', 'armeabi'\n }\n }\n}\n```\n\nWhen this flag is not configured, Gradle builds and packages all available ABIs.\n\nTo reduce the size of your APK, consider [configuring multiple APKs based on ABI](https://developer.android.com/studio/build/configure-apk-splits.html#configure-abi-split)---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. \n\n### cFlags\n\n```\nvar cFlags: String?\n```\n\nThe C Flags \n\n### debugSymbolLevel\n\n```\nvar debugSymbolLevel: String?\n```\n\nThe type of debug metadata which will be packaged in the app bundle.\n\nSupported values are 'none' (default, no native debug metadata will be packaged),\n'symbol_table' (only the symbol tables will be packaged), and 'full' (the debug info and\nsymbol tables will be packaged).\n\nExample usage: \n\n```\nandroid {\n buildTypes {\n release {\n ndk {\n debugSymbolLevel 'symbol_table'\n }\n }\n }\n}\n``` \n\n### jobs\n\n```\nvar jobs: Int?\n```\n\nNumber of parallel threads to spawn. \n\n### ldLibs\n\n```\nval ldLibs: MutableList\u003cString\u003e?\n```\n\nThe LD Libs \n\n### moduleName\n\n```\nvar moduleName: String?\n```\n\nThe module name \n\n### stl\n\n```\nvar stl: String?\n```\n\nThe APP_STL value"]]