Stay organized with collections
Save and categorize content based on your preferences.
JniLibsPackagingOptions
@Incubating interface JniLibsPackagingOptions
Packaging options for native library (.so) files
Summary
Public properties |
MutableSet<String> |
The set of excluded patterns.
|
MutableSet<String> |
The set of patterns for native libraries that should not be stripped of debug symbols.
|
MutableSet<String> |
The set of patterns where the first occurrence is packaged in the APK.
|
Boolean? |
Whether to use the legacy convention of compressing all .so files in the APK.
|
Public properties
excludes
val excludes: MutableSet<String>
The set of excluded patterns. Native libraries matching any of these patterns do not get packaged.
Example: android.packagingOptions.jniLibs.excludes += "**
/exclude.so"
keepDebugSymbols
val keepDebugSymbols: MutableSet<String>
The set of patterns for native libraries that should not be stripped of debug symbols.
Example: android.packagingOptions.jniLibs.keepDebugSymbols += "**
/doNotStrip.so"
pickFirsts
val pickFirsts: MutableSet<String>
The set of patterns where the first occurrence is packaged in the APK. For each native library APK entry path matching one of these patterns, only the first native library found with that path gets packaged.
Example: android.packagingOptions.jniLibs.pickFirsts += "**
/pickFirst.so"
useLegacyPackaging
val useLegacyPackaging: Boolean?
Whether to use the legacy convention of compressing all .so files in the APK. If null, .so files will be uncompressed and page-aligned when minSdk >= 23.
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,["# JniLibsPackagingOptions\n=======================\n\n\n```\n@Incubating interface JniLibsPackagingOptions\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nPackaging options for native library (.so) files\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` | [excludes](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/JniLibsPackagingOptions#excludes()) The set of excluded patterns. |\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` | [keepDebugSymbols](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/JniLibsPackagingOptions#keepDebugSymbols()) The set of patterns for native libraries that should not be stripped of debug symbols. |\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` | [pickFirsts](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/JniLibsPackagingOptions#pickFirsts()) The set of patterns where the first occurrence is packaged in the APK. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`?` | [useLegacyPackaging](/reference/tools/gradle-api/7.2/com/android/build/api/dsl/JniLibsPackagingOptions#useLegacyPackaging()) Whether to use the legacy convention of compressing all .so files in the APK. |\n\nPublic properties\n-----------------\n\n### excludes\n\n```\nval excludes: MutableSet\u003cString\u003e\n```\n\nThe set of excluded patterns. Native libraries matching any of these patterns do not get packaged.\n\nExample: `android.packagingOptions.jniLibs.excludes += \"**`/`exclude.so\"` \n\n### keepDebugSymbols\n\n```\nval keepDebugSymbols: MutableSet\u003cString\u003e\n```\n\nThe set of patterns for native libraries that should not be stripped of debug symbols.\n\nExample: `android.packagingOptions.jniLibs.keepDebugSymbols += \"**`/`doNotStrip.so\"` \n\n### pickFirsts\n\n```\nval pickFirsts: MutableSet\u003cString\u003e\n```\n\nThe set of patterns where the first occurrence is packaged in the APK. For each native library APK entry path matching one of these patterns, only the first native library found with that path gets packaged.\n\nExample: `android.packagingOptions.jniLibs.pickFirsts += \"**`/`pickFirst.so\"` \n\n### useLegacyPackaging\n\n```\nval useLegacyPackaging: Boolean?\n```\n\nWhether to use the legacy convention of compressing all .so files in the APK. If null, .so files will be uncompressed and page-aligned when minSdk \\\u003e= 23."]]