# Component

# Component

```
interface Component : Component
```

|------------------------------------------------------------------------------------------------------------------------------------------------------|
| [com.android.build.api.component.Component](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/component/Component#) |

|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Direct Subclasses [TestComponent](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/component/TestComponent), [Variant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Variant.html#) |-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------| | [TestComponent](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/component/TestComponent) | <br />                                      | | [Variant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Variant.html#)         | Parent interface for all types of variants. | |

|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known Indirect Subclasses [AndroidTest](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/component/AndroidTest), [ApplicationVariant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/ApplicationVariant.html#), [DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/DynamicFeatureVariant.html#), [LibraryVariant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/LibraryVariant.html#), [TestVariant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/TestVariant.html#), [UnitTest](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/component/UnitTest) |-------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------| | [AndroidTest](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/component/AndroidTest)                         | <br />                                                                                                                                     | | [ApplicationVariant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/ApplicationVariant.html#)       | Properties for the main Variant of an application.                                                                                         | | [DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/DynamicFeatureVariant.html#) | <br />                                                                                                                                     | | [LibraryVariant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/LibraryVariant.html#)               | [Variant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Variant.html#) for Library projects   | | [TestVariant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/TestVariant.html#)                     | [Variant](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Variant.html#) for test-only modules. | | [UnitTest](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/component/UnitTest)                               | Properties for the unit test variant of a module.                                                                                          | |

## Summary

| ### Inherited functions ||
|---|---|
| From class [Component](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Component.html#) |------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [setAsmFramesComputationMode](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Component.html#setAsmFramesComputationMode(com.android.build.api.instrumentation.FramesComputationMode))`(`mode:` `[FramesComputationMode](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/instrumentation/FramesComputationMode.html#)`)` Sets the frame computation mode that will be applied to the bytecode of the classes instrumented by ASM visitors registered through [transformClassesWith](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Component.html#transformClassesWith(java.lang.Class,%20com.android.build.api.instrumentation.InstrumentationScope,%20kotlin.Function1)). The default mode is to [copy frames](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/instrumentation/FramesComputationMode.html#ENUM_VALUE:COPY_FRAMES). When setting this multiple times, the mode with the highest enum value will be selected. <br />                                                                                                                                                                                                                     | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [transformClassesWith](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Component.html#transformClassesWith(java.lang.Class,%20com.android.build.api.instrumentation.InstrumentationScope,%20kotlin.Function1))`(`classVisitorFactoryImplClass:` `[Class](http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html)<out` `[AsmClassVisitorFactory](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/instrumentation/AsmClassVisitorFactory.html#)<ParamT>>`, `scope:` `[InstrumentationScope](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/instrumentation/InstrumentationScope.html#)`, `instrumentationParamsConfig:` `(ParamT)` `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` Registers an asm class visitor to instrument the classes defined by the given scope. An instance of the factory will be instantiated and used to create visitors for each class. Example: ```scdoc androidComponentsExtension.onVariants(selector().all(), { transformClassesWith(AsmClassVisitorFactoryImpl.class, InstrumentationScope.Project) { params -> params.x = "value" } setAsmFramesComputationMode(COMPUTE_FRAMES_FOR_INSTRUMENTED_METHODS) }) ``` <br /> | ||

| ### Inherited properties ||
|---|---|
| From class [Component](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Component.html#) |-------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Artifacts](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/artifact/Artifacts.html#)            | [artifacts](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Component.html#artifacts:com.android.build.api.artifact.Artifacts) Access to the variant's buildable artifacts for build customization. <br /> | | [JavaCompilation](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/JavaCompilation.html#) | [javaCompilation](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/Component.html#javaCompilation:com.android.build.api.variant.JavaCompilation) Access to the variant's java compilation options. <br />   | ||
| From class [ComponentIdentity](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/ComponentIdentity.html#) |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?                                                                                                                                                                                                                                                            | [buildType](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/ComponentIdentity.html#buildType:kotlin.String) Build type name, might be replaced with access to locked DSL object once ready. <br />                                                                                                                                                                                                                                          | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)?                                                                                                                                                                                                                                                            | [flavorName](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/ComponentIdentity.html#flavorName:kotlin.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/7.1/com/android/build/api/variant/ComponentIdentity.html#name:kotlin.String). <br /> | | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)                                                                                                                                                                                                                                                             | [name](https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/variant/ComponentIdentity.html#name:kotlin.String) Component's name. <br />                                                                                                                                                                                                                                                                                                                  | | [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/7.1/com/android/build/api/variant/ComponentIdentity.html#productFlavors:kotlin.collections.List) List of flavor names, might be replaced with access to locked DSL objects once ready. The order is properly sorted based on the associated dimension order. <br />                                                                                                                                          | ||