# DynamicFeatureAndroidComponentsExtension

# DynamicFeatureAndroidComponentsExtension

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


```
interface DynamicFeatureAndroidComponentsExtension : AndroidComponentsExtension
```

<br />

*** ** * ** ***

Extension for the Android Dynamic Feature Gradle Plugin components.

This is the `androidComponents` block when the `com.android.dynamic-feature` plugin is applied.

Only the Android Gradle Plugin should create instances of interfaces in com.android.build.api.variant.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From [com.android.build.api.variant.AndroidComponentsExtension](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension) |-------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                  | [beforeVariants](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#beforeVariants(com.android.build.api.variant.VariantSelector,org.gradle.api.Action))`(` ` selector: `[VariantSelector](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/VariantSelector)`,` ` callback: `[Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html)`<`[DynamicFeatureVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DynamicFeatureVariantBuilder)`>` `)` [Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html) based version of [beforeVariants](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#beforeVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)) above.                                                                                                                                                                                                                                                                                                                    | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                  | [beforeVariants](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#beforeVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1))`(` ` selector: `[VariantSelector](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/VariantSelector)`,` ` callback: (`[DynamicFeatureVariantBuilder](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DynamicFeatureVariantBuilder)`) `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) `)` Method to register a [callback](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#beforeVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)) to be called with [VariantBuilderT](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension) instances that satisfies the [selector](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#beforeVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)). | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                  | ~~[finalizeDSl](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#finalizeDSl(org.gradle.api.Action))~~`(callback: `[Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html)`<`[DynamicFeatureExtension](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/dsl/DynamicFeatureExtension)`>)` **This function is deprecated.** Replaced by finalizeDsl                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                  | [onVariants](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#onVariants(com.android.build.api.variant.VariantSelector,org.gradle.api.Action))`(` ` selector: `[VariantSelector](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/VariantSelector)`,` ` callback: `[Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html)`<`[DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DynamicFeatureVariant)`>` `)` [Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html) based version of [onVariants](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#onVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)) above.                                                                                                                                                                                                                                                                                                                                                  | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                  | [onVariants](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#onVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1))`(` ` selector: `[VariantSelector](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/VariantSelector)`,` ` callback: (`[DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DynamicFeatureVariant)`) `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) `)` Allow for registration of a [callback](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#onVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)) to be called with variant instances of type [VariantT](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension) once the list of [com.android.build.api.artifact.Artifact](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/artifact/Artifact) has been determined.                                                          | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                  | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [registerExtension](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#registerExtension(com.android.build.api.variant.DslExtension,kotlin.Function1))`(` ` dslExtension: `[DslExtension](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DslExtension)`,` ` configurator: (variantExtensionConfig: `[VariantExtensionConfig](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/VariantExtensionConfig)`<`[DynamicFeatureVariant](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DynamicFeatureVariant)`>) `->` `[VariantExtension](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/VariantExtension) `)` Register an Android Gradle Plugin DSL extension.                                                                                                                                                                                                                                                                                       | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)                                                  | `@`[Incubating](https://docs.gradle.org/current/javadoc/org/gradle/api/Incubating.html) [registerSourceType](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#registerSourceType(kotlin.String))`(name: `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Register a new source type to all source sets.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | [VariantSelector](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/VariantSelector) | [selector](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#selector())`()` Creates a [VariantSelector](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/VariantSelector) instance that can be configured to reduce the set of [ComponentBuilder](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/ComponentBuilder) instances participating in the [beforeVariants](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#beforeVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)) and [onVariants](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponentsExtension#onVariants(com.android.build.api.variant.VariantSelector,kotlin.Function1)) callback invocation.                                                                                                                                                                                                                                                                                                            | |
| From [com.android.build.api.variant.DslLifecycle](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DslLifecycle) |------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [finalizeDsl](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DslLifecycle#finalizeDsl(org.gradle.api.Action))`(callback: `[Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html)`<`[DynamicFeatureExtension](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/dsl/DynamicFeatureExtension)`>)` [Action](https://docs.gradle.org/current/javadoc/org/gradle/api/Action.html) based version of [finalizeDsl](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DslLifecycle#finalizeDsl(kotlin.Function1)) above. | | [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [finalizeDsl](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/DslLifecycle#finalizeDsl(kotlin.Function1))`(callback: (`[DynamicFeatureExtension](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/dsl/DynamicFeatureExtension)`) `->` `[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`)` API to customize the DSL Objects programmatically after they have been evaluated from the build files and before used in the build process next steps like variant or tasks creation.                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ### Inherited properties                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From [com.android.build.api.variant.AndroidComponents](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponents) |---------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [AndroidPluginVersion](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/AndroidPluginVersion) | [pluginVersion](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponents#pluginVersion()) The version of the Android Gradle Plugin currently in use.                     | | [SdkComponents](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/dsl/SdkComponents)           | [sdkComponents](https://developer.android.com/reference/tools/gradle-api/8.4/com/android/build/api/variant/AndroidComponents#sdkComponents()) Provides access to underlying Android SDK and build-tools components like adb. | |