GeneratesApkBuilder

Added in 7.4.0

interface GeneratesApkBuilder

Known direct subclasses
ApplicationVariantBuilder

Model for application components that only contains configuration-time properties that impacts the build flow.

DeviceTestBuilder

Interface to turn tests on devices, AndroidTest being an example of device tests.

DynamicFeatureVariantBuilder

Model for dynamic feature components that only contains configuration-time properties that impacts the build flow.

TestVariantBuilder

Model for test components that only contains configuration-time properties that impacts the build flow.

Known indirect subclasses

Configuration-time properties ComponentBuilder that produce APKs.

Summary

Public properties

Boolean?

Sets whether multi-dex is enabled for this variant.

Int?

Sets the target SDK Version for this variant as an integer API level.

String?

Sets the target SDK Version for this variant as an integer API level.

Public properties

enableMultiDex

Added in 8.5.2
Deprecated in 8.5.2
var enableMultiDexBoolean?

Sets whether multi-dex is enabled for this variant.

This can be null, in which case the default value is used.

It is not safe to read the value of this property as other plugins that were applied later can change this value so there is no guarantee you would get the final value. To get the final value, use the AndroidComponentsExtension.onVariants API :

onVariants { variant ->
variant.dexing.isMultiDexEnabled
}

Note the a RuntimeException will be thrown at Runtime if a java or groovy code tries to read the property value.

targetSdk

Added in 7.4.0
var targetSdkInt?

Sets the target SDK Version for this variant as an integer API level. Setting this will override previous calls of targetSdk and targetSdkPreview setters. Only one of targetSdk and targetSdkPreview should be set.

It is not safe to read this value. Use GeneratesApk.targetSdk instead.

targetSdkPreview

Added in 7.4.0
var targetSdkPreviewString?

Sets the target SDK Version for this variant as an integer API level. Setting this will override previous calls of targetSdk and targetSdkPreview setters. Only one of targetSdk and targetSdkPreview should be set.

It is not safe to read this value. Use GeneratesApk.targetSdk instead.