Stay organized with collections
Save and categorize content based on your preferences.
VariantOutput
@Incubating interface VariantOutput : VariantOutputConfiguration
Defines a variant output.
Summary
Properties
versionCode
abstract val versionCode: Property<Int?>
Returns a modifiable Property representing the variant output version code.
This will be initialized with the variant's merged flavor value or read from the manifest
file if unset.
versionName
abstract val versionName: Property<String?>
Returns a modifiable Property representing the variant output version name.
This will be initialized with the variant's merged flavor value, or it will be read from the
manifest source file if it's not set via the DSL, or it will be null if it's also not set in
the manifest.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# VariantOutput\n=============\n\n```\n@Incubating interface VariantOutput : VariantOutputConfiguration\n```\n\n|--------------------------------------------------|\n| [com.android.build.api.variant.VariantOutput](#) |\n\nDefines a variant output.\n\nSummary\n-------\n\n| ### Properties ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)\\\u003c[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)\\\u003e | [enabled](#enabled:org.gradle.api.provider.Property) Returns a modifiable [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html) to enable or disable the production of this [VariantOutput](#) |\n| abstract [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)\\\u003c[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)?\\\u003e | [versionCode](#versionCode:org.gradle.api.provider.Property) Returns a modifiable [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html) representing the variant output version code. |\n| abstract [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html)\\\u003c[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?\\\u003e | [versionName](#versionName:org.gradle.api.provider.Property) Returns a modifiable [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html) representing the variant output version name. |\n\n| ### Inherited properties ||\n|---|---|\n| From class [VariantOutputConfiguration](/reference/tools/gradle-api/4.1/com/android/build/api/variant/VariantOutputConfiguration) |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Collection](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-collection/index.html)\u003c[FilterConfiguration](/reference/tools/gradle-api/4.1/com/android/build/api/variant/FilterConfiguration)\u003e | [filters](/reference/tools/gradle-api/4.1/com/android/build/api/variant/VariantOutputConfiguration#filters:kotlin.collections.Collection) Returns a possibly empty list of [FilterConfiguration](/reference/tools/gradle-api/4.1/com/android/build/api/variant/FilterConfiguration) for this output. If the list is empty, this means there is no filter associated to this output. \u003cbr /\u003e | | [VariantOutputConfiguration.OutputType](/reference/tools/gradle-api/4.1/com/android/build/api/variant/VariantOutputConfiguration.OutputType) | [outputType](/reference/tools/gradle-api/4.1/com/android/build/api/variant/VariantOutputConfiguration#outputType:com.android.build.api.variant.VariantOutputConfiguration.OutputType) Returns the output type of the referenced APK. \u003cbr /\u003e | ||\n\nProperties\n----------\n\n### enabled\n\n```\nabstract val enabled: Property\u003cBoolean\u003e\n```\n\nReturns a modifiable [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html) to enable or disable the production of this [VariantOutput](#)\n\n| Return ||\n|---|---|\n| a [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html) to enable or disable this output. ||\n\n### versionCode\n\n```\nabstract val versionCode: Property\u003cInt?\u003e\n```\n\nReturns a modifiable [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html) representing the variant output version code.\n\nThis will be initialized with the variant's merged flavor value or read from the manifest\nfile if unset. \n\n### versionName\n\n```\nabstract val versionName: Property\u003cString?\u003e\n```\n\nReturns a modifiable [Property](https://docs.gradle.org/current/javadoc/org/gradle/api/provider/Property.html) representing the variant output version name.\n\nThis will be initialized with the variant's merged flavor value, or it will be read from the\nmanifest source file if it's not set via the DSL, or it will be null if it's also not set in\nthe manifest."]]