BuildFeatures

Added in 4.2.0

interface BuildFeatures : ExtensionAware

Known direct subclasses
ApplicationBuildFeatures

A list of build features that can be disabled or enabled in an Android Application project.

DynamicFeatureBuildFeatures

A list of build features that can be disabled or enabled in an Android Dynamic Feature project.

LibraryBuildFeatures

A list of build features that can be disabled or enabled in an Android Library project.

TestBuildFeatures

A list of build features that can be disabled or enabled in an Android Test project.


A list of build features that can be disabled or enabled in an Android project.

This list applies to all plugin types.

Summary

Public properties

Boolean?

Flag to enable AIDL compilation.

Boolean?

Flag to enable/disable generation of the BuildConfig class.

Boolean?

Flag to enable Compose feature.

Boolean?

Flag to enable/disable import of Prefab dependencies from AARs.

Boolean?

Flag to enable RenderScript compilation.

Boolean?

Flag to enable Resource Values generation.

Boolean?

Flag to enable Shader compilation.

Boolean?

Flag to enable View Binding.

Public properties

aidl

Added in 4.2.0
var aidlBoolean?

Flag to enable AIDL compilation.

Setting the value to null resets to the default value. Default value is false.

See AIDL.

buildConfig

Added in 4.2.0
var buildConfigBoolean?

Flag to enable/disable generation of the BuildConfig class.

Setting the value to null resets to the default value. Default value is false.

See build config fields.

compose

Added in 4.2.0
var composeBoolean?

Flag to enable Compose feature. Setting the value to null resets to the default value

Default value is false.

See Compose.

prefab

Added in 4.2.0
var prefabBoolean?

Flag to enable/disable import of Prefab dependencies from AARs.

Setting the value to null resets to the default value. Default value is false.

You can override the default for this in your module by setting android { buildFeatures { prefab true } } in the module's build.gradle file.

See Prefab.

renderScript

Added in 4.2.0
var renderScriptBoolean?

Flag to enable RenderScript compilation.

Setting the value to null resets to the default value. Default value is false.

resValues

Added in 4.2.0
var resValuesBoolean?

Flag to enable Resource Values generation.

Setting the value to null resets to the default value. Default value is true.

You can override the default for this for all projects in your build by adding the line android.defaults.buildfeatures.resvalues=true in the gradle.properties file at the root project of your build.

See Resources.

shaders

Added in 4.2.0
var shadersBoolean?

Flag to enable Shader compilation.

Setting the value to null resets to the default value. Default value is true.

You can override the default for this for all projects in your build by adding the line android.defaults.buildfeatures.shaders=true in the gradle.properties file at the root project of your build.

See Shader Compilers

viewBinding

Added in 4.2.0
var viewBindingBoolean?

Flag to enable View Binding.

Setting the value to null resets to the default value. Default value is false.

You can override the default for this for all projects in your build by adding the line android.defaults.buildfeatures.viewbinding=true in the gradle.properties file at the root project of your build.

See View Binding Library