Splits

@Incubating interface Splits


Options to configure Multiple APKs.

android.splits

If you publish your app to Google Play, you should build and upload an Android App Bundle. When you do so, Google Play automatically generates and serves optimized APKs for each user’s device configuration, so they download only the code and resources they need to run your app. This is much simpler than managing multiple APKs manually.

If you publish your app to a store that doesn't support the Android App Bundle format, you can publish multiple APKs manually.

The Android Gradle plugin supports generating multiple APKs based on screen density and Application Binary Interface (ABI), where each APK contains the code and resources required for a given device configuration.

You will also need to assign version codes to each APK so that you are able to manage updates later.

Previously the Android Gradle plugin also supported building 'Configuration APKs' for Instant Apps using this splits block, but that has been superseded by the Android App Bundle format.

Summary

Public functions

Unit

Encapsulates settings for building per-ABI APKs.

Unit

Encapsulates settings for building per-density APKs.

Public properties

AbiSplit

Encapsulates settings for building per-ABI APKs.

Collection<String>

Returns the list of ABIs that the plugin will generate separate APKs for.

DensitySplit

Encapsulates settings for building per-density APKs.

Collection<String>

Returns the list of screen density configurations that the plugin will generate separate APKs for.

Public functions

abi

fun abi(action: (@ExtensionFunctionType AbiSplit.() -> Unit)?): Unit

Encapsulates settings for building per-ABI APKs.

For more information about the properties you can configure in this block, see AbiSplit.

density

fun density(action: (@ExtensionFunctionType DensitySplit.() -> Unit)?): Unit

Encapsulates settings for building per-density APKs.

For more information about the properties you can configure in this block, see DensitySplit.

Public properties

abi

val abiAbiSplit

Encapsulates settings for building per-ABI APKs.

abiFilters

val abiFiltersCollection<String>

Returns the list of ABIs that the plugin will generate separate APKs for.

If this property returns null, it means the plugin will not generate separate per-ABI APKs. That is, each APK will include binaries for all ABIs your project supports.

Returns
Collection<String>

a set of ABIs.

density

val densityDensitySplit

Encapsulates settings for building per-density APKs.

densityFilters

val densityFiltersCollection<String>

Returns the list of screen density configurations that the plugin will generate separate APKs for.

If this property returns null, it means the plugin will not generate separate per-density APKs. That is, each APK will include resources for all screen density configurations your project supports.

Returns
Collection<String>

a set of screen density configurations.