JniLibsPackaging

Added in 8.0.2

interface JniLibsPackaging


Packaging options for native library (.so) files in the Android DSL

android {
packaging {
jniLibs {
excludes += ...
}
}
}

Summary

Public properties

MutableSet<String>

The set of excluded patterns.

MutableSet<String>

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

MutableSet<String>

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

MutableSet<String>

The set of test-only patterns.

Boolean?

Whether to use the legacy convention of compressing all .so files in the APK.

Public properties

excludes

Added in 8.0.2
val excludesMutableSet<String>

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

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

keepDebugSymbols

Added in 8.0.2
val keepDebugSymbolsMutableSet<String>

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

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

pickFirsts

Added in 8.0.2
val pickFirstsMutableSet<String>

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"

testOnly

Added in 8.4.0
val testOnlyMutableSet<String>

The set of test-only patterns. Native libraries matching any of these patterns do not get packaged in the main APK or AAR, but they are included in the test APK.

Example: android.packaging.jniLibs.testOnly += "**/testOnly.so"

useLegacyPackaging

Added in 8.0.2
var useLegacyPackagingBoolean?

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.