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