# ApplicationVariantBuilder

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


```
interface ApplicationVariantBuilder : VariantBuilder, HasDeviceTestsBuilder, HasAndroidTestBuilder, HasHostTestsBuilder, HasUnitTestBuilder, HasTestFixturesBuilder, HasTestSuitesBuilder, GeneratesApkBuilder, CanMinifyCodeBuilder, CanMinifyAndroidResourcesBuilder
```

<br />

*** ** * ** ***

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

See `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ComponentBuilder` and `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder` for more information.

## Summary

| ### Public properties |
|---|---|
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ApplicationAndroidResourcesBuilder` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ApplicationVariantBuilder#androidResources()` Access all configuration-time android resources processing properties. |
| `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/DependenciesInfoBuilder` | `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ApplicationVariantBuilder#dependenciesInfo()` Specify whether to include SDK dependency information in APKs and Bundles. |
| `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/ApplicationVariantBuilder#profileable()` **The getter for this property is deprecated.** Other plugins can change \`profileable\` value, it is not safe to read it at this stage |

### Inherited functions

From [com.android.build.api.variant.VariantBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html` `<T : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html> https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder#registerExtension(java.lang.Class,kotlin.Any)(type: https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html<T>, instance: T)`

Registers an extension object to the variant object.

### Inherited properties

From [com.android.build.api.variant.CanMinifyAndroidResourcesBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/CanMinifyAndroidResourcesBuilder) `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/CanMinifyAndroidResourcesBuilder#shrinkResources()`

Specifies whether resources will be shrinked
From [com.android.build.api.variant.CanMinifyCodeBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/CanMinifyCodeBuilder) `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/CanMinifyCodeBuilder#isMinifyEnabled()`

Specifies whether code will be minified
From [com.android.build.api.variant.ComponentBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ComponentBuilder) `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/ComponentBuilder#enable()`

Set to `true` if the variant is active and should be configured, false otherwise.
From [com.android.build.api.variant.ComponentIdentity](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/ComponentIdentity) `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/ComponentIdentity#buildType()`

Build type name.
`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/ComponentIdentity#flavorName()`

The multi-flavor name of the variant.
`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/ComponentIdentity#name()`

Component's name.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.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/ComponentIdentity#productFlavors()`

List of flavor names.
From [com.android.build.api.variant.GeneratesApkBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/GeneratesApkBuilder) `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/GeneratesApkBuilder#debuggable()`

**The getter for this property is deprecated.** Other plugins can change this value, it is not safe to read it at this stage
`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/GeneratesApkBuilder#enableMultiDex()`

**The getter for this property is deprecated.** Other plugins can change this value, it is not safe to read it at this stage
From [com.android.build.api.variant.HasAndroidTestBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasAndroidTestBuilder) `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidTestBuilder` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasAndroidTestBuilder#androidTest()`

Variant's `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidTestBuilder` configuration to turn on or off android tests and set other android test related settings.
`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/HasAndroidTestBuilder#androidTestEnabled()`

Set to `true` if the variant's has any android tests, false otherwise.
`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/HasAndroidTestBuilder#enableAndroidTest()`

Set to `true` if the variant's has any android tests, false otherwise.
From [com.android.build.api.variant.HasDeviceTestsBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasDeviceTestsBuilder) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.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/DeviceTestBuilder>` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasDeviceTestsBuilder#deviceTests()`

List of `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/DeviceTestBuilder` for this variant.
From [com.android.build.api.variant.HasHostTestsBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasHostTestsBuilder) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.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/HostTestBuilder>` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasHostTestsBuilder#hostTests()`

Variant's `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HostTestBuilder` configuration to turn on or off screenshot tests and set other screenshot test related settings.
From [com.android.build.api.variant.HasTestFixturesBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasTestFixturesBuilder) `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/HasTestFixturesBuilder#enableTestFixtures()`

Set to `true` if the variant's has test fixtures, `false` otherwise.
From [com.android.build.api.variant.HasTestSuitesBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasTestSuitesBuilder) `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.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/TestSuiteBuilder>` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/HasTestSuitesBuilder#suites()`

Variant's `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/TestSuiteBuilder` configuration to configure test suites associated with this variant.
From [com.android.build.api.variant.VariantBuilder](https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder) `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/VariantBuilder#enableLint()`

Whether lint should be run on this variant.
`https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/LintBuilder` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder#lint()`

Access to build-time configuration for lint.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html?` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder#maxSdk()`

Sets the maximum supported SDK Version for this variant.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html?` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder#minSdk()`

Sets the minimum supported SDK Version for this variant.
`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/VariantBuilder#minSdkPreview()`

Sets the minimum supported SDK Version for this variant as a Preview codename.
`https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/VariantBuilder#renderscriptTargetApi()`

Specifies the bytecode version to be generated.

## Public properties

### androidResources

Added in 8.4.0

```
val androidResources: ApplicationAndroidResourcesBuilder
```

Access all configuration-time android resources processing properties.

### dependenciesInfo

Added in 4.2.0

```
val dependenciesInfo: DependenciesInfoBuilder
```

Specify whether to include SDK dependency information in APKs and Bundles.

### profileable

Added in 8.3.1 Deprecated in 8.3.1

```
var profileable: Boolean
```

> [!CAUTION]
> **The getter for this property is deprecated.**   
> Other plugins can change \`profileable\` value, it is not safe to read it at this stage

Set to `true` if the variant is profileable, false otherwise. Default value is calculated based on options and DSL.

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 `https://developer.android.com/reference/tools/gradle-api/9.6/com/android/build/api/variant/AndroidComponentsExtension#onVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)` API :

```
onVariants { variant ->
  variant.profileable
}
```

Note the a `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-runtime-exception/index.html` will be thrown at Runtime if a java or groovy code tries to read the property value.