Stay organized with collections
Save and categorize content based on your preferences.
PackagingOptions
@Incubating interface PackagingOptions
Summary
Public methods
|
abstract Unit |
Adds a doNotStrip pattern.
|
abstract Unit |
Adds an excluded pattern.
|
abstract Unit |
Adds a merge pattern.
|
abstract Unit |
Adds a first-pick pattern.
|
Properties
|
abstract MutableSet<String> |
The list of patterns for native library that should not be stripped of debug symbols.
|
abstract MutableSet<String> |
The list of excluded paths.
|
abstract MutableSet<String> |
The list of patterns where all occurrences are concatenated and packaged in the APK.
|
abstract MutableSet<String> |
The list of patterns where the first occurrence is packaged in the APK.
|
Public methods
doNotStrip
abstract fun doNotStrip(pattern: String): Unit
Adds a doNotStrip pattern.
Parameters |
pattern: String |
the pattern, as packaged in the APK |
exclude
abstract fun exclude(pattern: String): Unit
Adds an excluded pattern.
Parameters |
pattern: String |
the pattern |
merge
abstract fun merge(pattern: String): Unit
Adds a merge pattern.
Parameters |
pattern: String |
the pattern, as packaged in the APK |
pickFirst
abstract fun pickFirst(pattern: String): Unit
Adds a first-pick pattern.
Parameters |
pattern: String |
the path to add. |
Properties
doNotStrip
abstract val doNotStrip: MutableSet<String>
The list of patterns for native library that should not be stripped of debug symbols.
Example: packagingOptions.doNotStrip "*
/armeabi-v7a/libhello-jni.so"
merges
abstract val merges: MutableSet<String>
The list of patterns where all occurrences are concatenated and packaged in the APK.
pickFirsts
abstract val pickFirsts: MutableSet<String>
The list of patterns where the first occurrence is packaged in the APK. First pick patterns
do get packaged in the APK, but only the first occurrence found gets packaged.
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,["# PackagingOptions\n================\n\n```\n@Incubating interface PackagingOptions\n```\n\n|-------------------------------------------------|\n| [com.android.build.api.dsl.PackagingOptions](#) |\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [doNotStrip](#doNotStrip(kotlin.String))`(`pattern:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds a doNotStrip pattern. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [exclude](#exclude(kotlin.String))`(`pattern:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds an excluded pattern. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [merge](#merge(kotlin.String))`(`pattern:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds a merge pattern. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [pickFirst](#pickFirst(kotlin.String))`(`pattern:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds a first-pick pattern. |\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 | [doNotStrip](#doNotStrip:kotlin.collections.MutableSet) The list of patterns for native library 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 | [excludes](#excludes:kotlin.collections.MutableSet) The list of excluded paths. |\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 | [merges](#merges:kotlin.collections.MutableSet) The list of patterns where all occurrences are concatenated and packaged in the APK. |\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 list of patterns where the first occurrence is packaged in the APK. |\n\nPublic methods\n--------------\n\n### doNotStrip\n\n```\nabstract fun doNotStrip(pattern: String): Unit\n```\n\nAdds a doNotStrip pattern.\n\n| Parameters ||\n|-------------------------------------------------------------------------------------------|-------------------------------------|\n| pattern: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the pattern, as packaged in the APK |\n\n### exclude\n\n```\nabstract fun exclude(pattern: String): Unit\n```\n\nAdds an excluded pattern.\n\n| Parameters ||\n|-------------------------------------------------------------------------------------------|-------------|\n| pattern: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the pattern |\n\n### merge\n\n```\nabstract fun merge(pattern: String): Unit\n```\n\nAdds a merge pattern.\n\n| Parameters ||\n|-------------------------------------------------------------------------------------------|-------------------------------------|\n| pattern: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the pattern, as packaged in the APK |\n\n### pickFirst\n\n```\nabstract fun pickFirst(pattern: String): Unit\n```\n\nAdds a first-pick pattern.\n\n| Parameters ||\n|-------------------------------------------------------------------------------------------|------------------|\n| pattern: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the path to add. |\n\nProperties\n----------\n\n### doNotStrip\n\n```\nabstract val doNotStrip: MutableSet\u003cString\u003e\n```\n\nThe list of patterns for native library that should not be stripped of debug symbols.\n\nExample: `packagingOptions.doNotStrip \"*`/`armeabi-v7a/libhello-jni.so\"` \n\n### excludes\n\n```\nabstract val excludes: MutableSet\u003cString\u003e\n```\n\nThe list of excluded paths. \n\n### merges\n\n```\nabstract val merges: MutableSet\u003cString\u003e\n```\n\nThe list of patterns where all occurrences are concatenated and packaged in the APK. \n\n### pickFirsts\n\n```\nabstract val pickFirsts: MutableSet\u003cString\u003e\n```\n\nThe list of patterns where the first occurrence is packaged in the APK. First pick patterns\ndo get packaged in the APK, but only the first occurrence found gets packaged."]]