# JniLibsApkPackaging

# JniLibsApkPackaging

```
interface JniLibsApkPackaging : JniLibsPackaging
```

|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [com.android.build.api.variant.JniLibsApkPackaging](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JniLibsApkPackaging#) |

Defines an APK variant's packaging options for native library (.so) files.

## Summary

|                                                                                                                                                                                                                         ### Properties                                                                                                                                                                                                                          ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| abstract[Provider](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)\<[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)\> | [useLegacyPackaging](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackaging:org.gradle.api.provider.Provider) Whether to use the legacy convention of compressing all .                     |
| abstract[Provider](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Provider.html)\<[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)\> | [useLegacyPackagingFromBundle](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackagingFromBundle:org.gradle.api.provider.Provider) Whether to use the legacy convention of compressing all . |

| ### Inherited properties ||
|---|---|
| From class[JniLibsPackaging](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JniLibsPackaging) |-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [SetProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> | [excludes](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JniLibsPackaging#excludes:org.gradle.api.provider.SetProperty) <br /> The set of excluded patterns. Native libraries matching any of these patterns do not get packaged. Example usage:`packaging.jniLibs.excludes.add("**`/`exclude.so")` <br />                                                                                                                          | | [SetProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> | [keepDebugSymbols](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JniLibsPackaging#keepDebugSymbols:org.gradle.api.provider.SetProperty) <br /> The set of patterns for native libraries that should not be stripped of debug symbols. Example:`packaging.jniLibs.keepDebugSymbols.add("**`/`doNotStrip.so")` <br />                                                                                                                 | | [SetProperty](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html)<[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)> | [pickFirsts](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JniLibsPackaging#pickFirsts:org.gradle.api.provider.SetProperty) <br /> The set of patterns for which 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 usage:`packaging.jniLibs.pickFirsts.add("**`/`pickFirst.so")` <br /> | ||

## Properties

### useLegacyPackaging

```
abstract val useLegacyPackaging: Provider<Boolean>
```

Whether to use the legacy convention of compressing all .so files in the APK. This does not affect APKs generated from the app bundle; see[useLegacyPackagingFromBundle](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackagingFromBundle:org.gradle.api.provider.Provider).  

### useLegacyPackagingFromBundle

```
abstract val useLegacyPackagingFromBundle: Provider<Boolean>
```

Whether to use the legacy convention of compressing all .so files when generating APKs from the app bundle. If true, .so files will always be compressed when generating APKs from the app bundle, regardless of the API level of the target device. If false, .so files will be compressed only when targeting devices with API level \< M.