# ComponentIdentity

# ComponentIdentity

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

<br />

```
interface ComponentIdentity
```

<br />

Known direct subclasses  
[ComponentBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ComponentBuilder),[Component](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/Component)  

|---------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------|
| [ComponentBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ComponentBuilder) | Model for components that only contains configuration-time properties that impacts the build flow. |
| [Component](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/Component)               | Model for components that only contains build-time properties                                      |

Known indirect subclasses  
[AndroidTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/AndroidTest),[ApplicationVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ApplicationVariantBuilder),[ApplicationVariant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ApplicationVariant),[DeviceTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/DeviceTest),[DynamicFeatureVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/DynamicFeatureVariantBuilder),[DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/DynamicFeatureVariant),[HostTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/HostTest),[LibraryVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/LibraryVariantBuilder),[LibraryVariant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/LibraryVariant),[TestComponent](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/TestComponent),[TestFixtures](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/TestFixtures),[TestVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/TestVariantBuilder),[TestVariant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/TestVariant),[UnitTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/component/UnitTest),[UnitTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/UnitTest),[VariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/VariantBuilder),[Variant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/Variant)  

|---------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| [AndroidTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/AndroidTest)                                   | Model for Android Test components that contains build-time properties                                                           |
| [ApplicationVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ApplicationVariantBuilder)       | Model for application components that only contains configuration-time properties that impacts the build flow.                  |
| [ApplicationVariant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ApplicationVariant)                     | Model for application components that only contains build-time properties.                                                      |
| [DeviceTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/DeviceTest)                                     | Model for Device Test components that contains build-time properties                                                            |
| [DynamicFeatureVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/DynamicFeatureVariantBuilder) | Model for dynamic feature components that only contains configuration-time properties that impacts the build flow.              |
| [DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/DynamicFeatureVariant)               | Model for dynamic feature components that only contains build-time properties.                                                  |
| [HostTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/HostTest)                                         | Model for Host Test components that contains build-time properties.                                                             |
| [LibraryVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/LibraryVariantBuilder)               | Model for library components that only contains configuration-time properties that impacts the build flow.                      |
| [LibraryVariant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/LibraryVariant)                             | Model for library components that only contains build-time properties.                                                          |
| [TestComponent](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/TestComponent)                               | Model for test components that contains build-time properties.                                                                  |
| [TestFixtures](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/TestFixtures)                                 | Model for Test Fixtures components that contains build-time properties                                                          |
| [TestVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/TestVariantBuilder)                     | Model for test components that only contains configuration-time properties that impacts the build flow.                         |
| [TestVariant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/TestVariant)                                   | Model for test components that only contains build-time properties.                                                             |
| [UnitTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/component/UnitTest)                                       | **This interface is deprecated.**Use the com.android.build.api.variant package                                                  |
| [UnitTest](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/UnitTest)                                         | [Component](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/Component)for unit tests |
| [VariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/VariantBuilder)                             | Model for variant components that only contains configuration-time properties that impacts the build flow.                      |
| [Variant](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/Variant)                                           | Model for variant components that only contains build-time properties                                                           |

*** ** * ** ***

Variant Configuration represents the identify of a variant

This is computed from the list of build types and flavors.

## Summary

|                                                                                                                                                               ### Public properties                                                                                                                                                                |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                                                                                                                                                                                                                                                                | [buildType](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ComponentIdentity#buildType()) Build type name.                        |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?`                                                                                                                                                                                                                                                                | [flavorName](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ComponentIdentity#flavorName()) The multi-flavor name of the variant. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                                                                                                                                                                                   | [name](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ComponentIdentity#name()) Component's name.                                 |
| [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[Pair](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-pair/index.html)`<`[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>>` | [productFlavors](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ComponentIdentity#productFlavors()) List of flavor names.         |

## Public properties

### buildType

Added in 7.0.0  

```
val buildType: String?
```

Build type name.  

### flavorName

Added in 7.0.0  

```
val flavorName: String?
```

The multi-flavor name of the variant.

This does not include the build type. If no flavors are present, this will return null

The full name of the variant is queried via[name](https://developer.android.com/reference/tools/gradle-api/8.8/com/android/build/api/variant/ComponentIdentity#name()).  

### name

Added in 7.0.0  

```
val name: String
```

Component's name.  

### productFlavors

Added in 7.0.0  

```
val productFlavors: List<Pair<String, String>>
```

List of flavor names.

The order is properly sorted based on the associated dimension order.