# JniLibsPackaging

# JniLibsPackaging

<br />

```
public interface JniLibsPackaging
```

<br />

*** ** * ** ***

Packaging options for native library (.so) files

## Summary

|                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `abstract @`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[Set](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html)`<@`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html)`>` | [getExcludes](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/JniLibsPackaging#getExcludes())`()` The set of excluded patterns.                                                                                                                                                                                                      |
| `abstract @`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[Set](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html)`<@`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html)`>` | [getKeepDebugSymbols](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/JniLibsPackaging#getKeepDebugSymbols())`()` The set of patterns for native libraries that should not be stripped of debug symbols.                                                                                                                             |
| `abstract @`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[Set](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Set.html)`<@`[NonNull](https://developer.android.com/reference/tools/gradle-api/8.3/null/androidx/annotation/NonNull)` `[String](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html)`>` | [getPickFirsts](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/JniLibsPackaging#getPickFirsts())`()` The set of patterns where the first occurrence is packaged in the APK.                                                                                                                                                         |
| `abstract `[Boolean](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Boolean.html)                                                                                                                                                                                                                                                                                                                   | [getUseLegacyPackaging](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/JniLibsPackaging#getUseLegacyPackaging())`()` Whether to use the legacy convention of compressing all .so files in the APK.                                                                                                                                  |
| `abstract void`                                                                                                                                                                                                                                                                                                                                                                                                             | [setUseLegacyPackaging](https://developer.android.com/reference/tools/gradle-api/8.3/null/com/android/build/api/dsl/JniLibsPackaging#setUseLegacyPackaging(kotlin.Boolean))`(`[Boolean](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Boolean.html)` useLegacyPackaging)` Whether to use the legacy convention of compressing all .so files in the APK. |

## Public methods

### getExcludes

```
abstract @NonNull Set<@NonNull String> getExcludes()
```

The set of excluded patterns. Native libraries matching any of these patterns do not get packaged.

Example:`android.packagingOptions.jniLibs.excludes += "**`/`exclude.so"`  

### getKeepDebugSymbols

```
abstract @NonNull Set<@NonNull String> getKeepDebugSymbols()
```

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

Example:`android.packagingOptions.jniLibs.keepDebugSymbols += "**`/`doNotStrip.so"`  

### getPickFirsts

```
abstract @NonNull Set<@NonNull String> getPickFirsts()
```

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"`  

### getUseLegacyPackaging

```
abstract Boolean getUseLegacyPackaging()
```

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.  

### setUseLegacyPackaging

```
abstract void setUseLegacyPackaging(Boolean useLegacyPackaging)
```

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.