# JniLibsApkPackaging

[View Source](https://cs.android.com/search?q=file:com/android/build/api/variant/JniLibsApkPackaging.kt+class:com.android.build.api.variant.JniLibsApkPackaging) Added in 7.0.0


```
interface JniLibsApkPackaging : JniLibsPackaging
```

<br />

Known direct subclasses [JniLibsTestedApkPackaging](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsTestedApkPackaging)

|---|---|
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsTestedApkPackaging` | Build-time properties for packaging native libraries (.so) inside a tested APK `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/Component`. |

*** ** * ** ***

Build-time properties for packaging native libraries (.so) inside an APK `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/Component`.

This is accessed via `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ApkPackaging#jniLibs()`

## Summary

| ### Public properties |
|---|---|
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackaging()` Whether to use the legacy convention of compressing all .so files in the APK. |
| `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html>` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackagingFromBundle()` Whether to use the legacy convention of compressing all .so files when generating APKs from the app bundle. |

### Inherited properties

From [com.android.build.api.variant.JniLibsPackaging](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsPackaging) `https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsPackaging#excludes()`

The set of excluded patterns.
`https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsPackaging#keepDebugSymbols()`

The set of patterns for native libraries that should not be stripped of debug symbols.
`https://docs.gradle.org/current/javadoc/org/gradle/api/provider/SetProperty.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html>` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsPackaging#pickFirsts()`

The set of patterns for which the first occurrence is packaged in the APK.

## Public properties

### useLegacyPackaging

Added in 7.0.0

```
val useLegacyPackaging: Property<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 `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackagingFromBundle()`.

This property is initialized from the `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/JniLibsPackaging#useLegacyPackaging()` DSL element, if set. If this property and the DSL are unset, .so files will be uncompressed and page-aligned when minSdk \>= 23. If this property is set, the value will be fed directly to the corresponding Gradle tasks without extra logic.

If setting this property, consider also setting `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackagingFromBundle()` to the same value so that .so files are packaged consistently when API level \>= 23, whether an APK is generated from the app bundle or not.

### useLegacyPackagingFromBundle

Added in 7.0.0

```
val useLegacyPackagingFromBundle: Property<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 \< 23.

This property is initialized from the `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/dsl/JniLibsPackaging#useLegacyPackaging()` DSL element, if set. If this property and the DSL are unset, this property's value defaults to false.

If setting this property to true, consider also setting `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/JniLibsApkPackaging#useLegacyPackaging()` to true so that .so files are packaged consistently, whether an APK is generated from the app bundle or not.