# PackagingOptions

# PackagingOptions

```
@Incubating interface PackagingOptions
```

|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| [com.android.build.api.dsl.PackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#) |

## Summary

|                                                                                                                                                                                                                                                       ### Public methods                                                                                                                                                                                                                                                       ||
|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [dex](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#dex(kotlin.Function1))`(`action:` `[DexPackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/DexPackagingOptions).()` `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` PackagingOptions for dex                                    |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [doNotStrip](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#doNotStrip(kotlin.String))`(`pattern:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds a doNotStrip pattern.                                                                                                                                                              |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [exclude](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#exclude(kotlin.String))`(`pattern:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds an excluded pattern.                                                                                                                                                                     |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [jniLibs](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#jniLibs(kotlin.Function1))`(`action:` `[JniLibsPackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/JniLibsPackagingOptions).()` `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` PackagingOptions for jniLibs                |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [merge](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#merge(kotlin.String))`(`pattern:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds a merge pattern.                                                                                                                                                                             |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [pickFirst](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#pickFirst(kotlin.String))`(`pattern:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Adds a first-pick pattern.                                                                                                                                                                |
| abstract[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [resources](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#resources(kotlin.Function1))`(`action:` `[ResourcesPackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/ResourcesPackagingOptions).()` `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` PackagingOptions for java resources |

|                                                                                                                                                                                                                     ### Properties                                                                                                                                                                                                                     ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[DexPackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/DexPackagingOptions)                                                         | [dex](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#dex:com.android.build.api.dsl.DexPackagingOptions) PackagingOptions for dex                                                           |
| abstract[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)\> | [doNotStrip](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#doNotStrip:kotlin.collections.MutableSet) The set of patterns for native library that should not be stripped of debug symbols. |
| abstract[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)\> | [excludes](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#excludes:kotlin.collections.MutableSet) The set of excluded paths.                                                               |
| abstract[JniLibsPackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/JniLibsPackagingOptions)                                                 | [jniLibs](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#jniLibs:com.android.build.api.dsl.JniLibsPackagingOptions) PackagingOptions for jniLibs                                           |
| abstract[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)\> | [merges](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#merges:kotlin.collections.MutableSet) The set of patterns where all occurrences are concatenated and packaged in the APK.          |
| abstract[MutableSet](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-set/index.html)\<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)\> | [pickFirsts](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#pickFirsts:kotlin.collections.MutableSet) The set of patterns where the first occurrence is packaged in the APK.               |
| abstract[ResourcesPackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/ResourcesPackagingOptions)                                             | [resources](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions#resources:com.android.build.api.dsl.ResourcesPackagingOptions) PackagingOptions for java resources                              |

## Public methods

### dex

```
abstract fun dex(action: DexPackagingOptions.() -> Unit): Unit
```

PackagingOptions for dex  

### doNotStrip

```
abstract fun doNotStrip(pattern: String): Unit
```

**Deprecated.**

Adds a doNotStrip pattern.

|                                                          Parameters                                                           ||
|------------------------------------------------------------------------------------------|-------------------------------------|
| pattern:[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the pattern, as packaged in the APK |

### exclude

```
abstract fun exclude(pattern: String): Unit
```

**Deprecated.**

Adds an excluded pattern.

|                                              Parameters                                               ||
|------------------------------------------------------------------------------------------|-------------|
| pattern:[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the pattern |

### jniLibs

```
abstract fun jniLibs(action: JniLibsPackagingOptions.() -> Unit): Unit
```

PackagingOptions for jniLibs  

### merge

```
abstract fun merge(pattern: String): Unit
```

**Deprecated.**

Adds a merge pattern.

|                                                          Parameters                                                           ||
|------------------------------------------------------------------------------------------|-------------------------------------|
| pattern:[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the pattern, as packaged in the APK |

### pickFirst

```
abstract fun pickFirst(pattern: String): Unit
```

**Deprecated.**

Adds a first-pick pattern.

|                                                 Parameters                                                 ||
|------------------------------------------------------------------------------------------|------------------|
| pattern:[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | the path to add. |

### resources

```
abstract fun resources(action: ResourcesPackagingOptions.() -> Unit): Unit
```

PackagingOptions for java resources

## Properties

### dex

```
abstract val dex: DexPackagingOptions
```

PackagingOptions for dex  

### doNotStrip

```
abstract val doNotStrip: MutableSet<String>
```

**Deprecated.**

The set of patterns for native library that should not be stripped of debug symbols.  

### excludes

```
abstract val excludes: MutableSet<String>
```

**Deprecated.**

The set of excluded paths.  

### jniLibs

```
abstract val jniLibs: JniLibsPackagingOptions
```

PackagingOptions for jniLibs  

### merges

```
abstract val merges: MutableSet<String>
```

**Deprecated.**

The set of patterns where all occurrences are concatenated and packaged in the APK.  

### pickFirsts

```
abstract val pickFirsts: MutableSet<String>
```

**Deprecated.**

The set 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.  

### resources

```
abstract val resources: ResourcesPackagingOptions
```

PackagingOptions for java resources