Stay organized with collections
Save and categorize content based on your preferences.
JniLibsPackaging
interface JniLibsPackaging
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
var 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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# JniLibsPackaging\n================\n\n\n```\ninterface JniLibsPackaging\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/8.0/com/android/build/api/dsl/JniLibsPackaging#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/8.0/com/android/build/api/dsl/JniLibsPackaging#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/8.0/com/android/build/api/dsl/JniLibsPackaging#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/8.0/com/android/build/api/dsl/JniLibsPackaging#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```\nvar 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."]]