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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# VariantFilter\n=============\n\n\n```\ninterface VariantFilter\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n| **This interface is deprecated.** \n| Use AndroidComponentsExtension.beforeVariants API to disable specific variants\n\nInterface for variant control, allowing to query a variant for some base data and allowing to disable some variants.\n\nSummary\n-------\n\n| ### Public properties ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [BuildType](/reference/tools/gradle-api/8.2/com/android/builder/model/BuildType) | [buildType](/reference/tools/gradle-api/8.2/com/android/build/api/variant/VariantFilter#buildType()) Returns the Build Type. |\n| [ProductFlavor](/reference/tools/gradle-api/8.2/com/android/builder/model/ProductFlavor) | [defaultConfig](/reference/tools/gradle-api/8.2/com/android/build/api/variant/VariantFilter#defaultConfig()) Returns the ProductFlavor that represents the default config. |\n| [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`\u003c`[ProductFlavor](/reference/tools/gradle-api/8.2/com/android/builder/model/ProductFlavor)`\u003e` | [flavors](/reference/tools/gradle-api/8.2/com/android/build/api/variant/VariantFilter#flavors()) Returns the list of flavors, or an empty list. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [ignore](/reference/tools/gradle-api/8.2/com/android/build/api/variant/VariantFilter#ignore()) Whether or not to ignore this particular variant. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [name](/reference/tools/gradle-api/8.2/com/android/build/api/variant/VariantFilter#name()) Returns the unique variant name. |\n\nPublic properties\n-----------------\n\n### buildType\n\n```\nval buildType: BuildType\n```\n\nReturns the Build Type. \n\n### defaultConfig\n\n```\nval defaultConfig: ProductFlavor\n```\n\nReturns the ProductFlavor that represents the default config. \n\n### flavors\n\n```\nval flavors: List\u003cProductFlavor\u003e\n```\n\nReturns the list of flavors, or an empty list. \n\n### ignore\n\n```\nvar ignore: Boolean\n```\n\nWhether or not to ignore this particular variant. Default is false. \n\n### name\n\n```\nval name: String\n```\n\nReturns the unique variant name."]]