ApplicationExtension

Added in 4.2.0

interface ApplicationExtension : CommonExtension, ApkExtension, TestedExtension


Extension for the Android Gradle Plugin Application plugin.

This is the android block when the com.android.application plugin is applied.

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

Summary

Public functions

Unit
bundle(action: Bundle.() -> Unit)
Unit

Specify whether to include SDK dependency information in APKs and Bundles.

Unit
Unit

Customizes publishing build variant artifacts from app module to a Maven repository.

Public properties

ApplicationAndroidResources

Specifies options related to the processing of Android Resources.

MutableSet<String>

Set of asset pack subprojects to be included in the app's bundle.

Bundle
DependenciesInfo

Specify whether to include SDK dependency information in APKs and Bundles.

MutableSet<String>
ApplicationInstallation

Specifies options for the Android Debug Bridge (ADB), such as APK installation options.

PrivacySandbox

Options related to the consumption of privacy sandbox libraries

ApplicationPublishing

Customizes publishing build variant artifacts from app module to a Maven repository.

Inherited functions

From com.android.build.api.dsl.CommonExtension
Unit
aaptOptions(action: AaptOptions.() -> Unit)

This function is deprecated. Replaced by

Unit
adbOptions(action: AdbOptions.() -> Unit)

This function is deprecated. Replaced by installation

Unit

Specifies options related to the processing of Android Resources.

Unit

A list of build features that can be enabled or disabled on the Android Project.

Unit
buildToolsVersion(buildToolsVersion: String)

This function is deprecated. Replaced by buildToolsVersion property

Unit

Encapsulates all build type configurations for this project.

Unit

Specifies Java compiler options, such as the language level of the Java source code and generated bytecode.

Unit
compileSdkAddon(vendor: String, name: String, version: Int)

Specify an SDK add-on to compile your project against.

Unit

This function is deprecated. Replaced by compileSdk

Unit

This function is deprecated. Replaced by compileSdkPreview

Unit
Unit
dataBinding(action: DataBinding.() -> Unit)

Specifies options for the Data Binding Library.

Unit

Shortcut extension method to allow easy access to the predefined debug BuildType

Unit

Specifies defaults for variant properties that the Android plugin applies to all build variants.

Unit

Specifies options for external native build using CMake or ndk-build.

Unit
flavorDimensions(vararg dimensions: String)

This function is deprecated. Replaced by flavorDimensions property

File
Unit

Specifies options for the Android Debug Bridge (ADB), such as APK installation options.

Unit

This function is deprecated. Renamed to testCoverage

Unit
lint(action: Lint.() -> Unit)

Specifies options for the lint tool.

Unit

This function is deprecated. Renamed to lint

Unit
packaging(action: Packaging.() -> Unit)

Specifies options and rules that determine which files the Android plugin packages into your APK.

Unit

This function is deprecated. Renamed to packaging

Unit

Encapsulates all product flavors configurations for this project.

Unit

Shortcut extension method to allow easy access to the predefined release BuildType

Unit

Encapsulates signing configurations that you can apply to BuildType and ProductFlavor configurations.

Unit

Encapsulates source set configurations for all variants.

Unit
splits(action: Splits.() -> Unit)

Specifies configurations for building multiple APKs or APK splits.

Unit

Configure the gathering of code-coverage from tests.

Unit

Specifies options for how the Android plugin should run local and instrumented tests.

Unit

Includes the specified library to the classpath.

Unit
useLibrary(name: String, required: Boolean)

Includes the specified library to the classpath.

Unit
viewBinding(action: ViewBinding.() -> Unit)

Specifies options for the View Binding Library.

From com.android.build.api.dsl.TestedExtension
Unit

Options to configure the test fixtures.

Inherited properties

From com.android.build.api.dsl.CommonExtension
AaptOptions

This property is deprecated. Replaced by

AdbOptions

This property is deprecated. Replaced by installation

ApplicationBuildFeatures

A list of build features that can be enabled or disabled on the Android Project.

String

Specifies the version of the SDK Build Tools to use when building your project.

NamedDomainObjectContainer<ApplicationBuildType>

Encapsulates all build type configurations for this project.

CompileOptions

Specifies Java compiler options, such as the language level of the Java source code and generated bytecode.

Int?

Specifies the API level to compile your project against.

Int?

Specifies the SDK Extension level to compile your project against.

String?

Specify a preview API to compile your project against.

ComposeOptions
DataBinding

Specifies options for the Data Binding Library.

ApplicationDefaultConfig

Specifies defaults for variant properties that the Android plugin applies to all build variants.

MutableMap<StringAny>

Additional per module experimental properties.

ExternalNativeBuild

Specifies options for external native build using CMake or ndk-build.

MutableList<String>

Specifies the names of product flavor dimensions for this project.

JacocoOptions

This property is deprecated. Renamed to testCoverage

Lint

Specifies options for the lint tool.

LintOptions

This property is deprecated. Renamed to lint

String?

The namespace of the generated R and BuildConfig classes.

String?

Requires the specified path to NDK be used.

String

Requires the specified NDK version to be used.

Packaging

Specifies options and rules that determine which files the Android plugin packages into your APK.

Packaging

This property is deprecated. Renamed to packaging

NamedDomainObjectContainer<ApplicationProductFlavor>

Encapsulates all product flavors configurations for this project.

String?

Specifies this project's resource prefix to Android Studio for editor features, such as Lint checks.

SdkComponents
NamedDomainObjectContainer<ApkSigningConfig>

Encapsulates signing configurations that you can apply to [ ] and [ ] configurations.

NamedDomainObjectContainer<AndroidSourceSet>

Encapsulates source set configurations for all variants.

Splits

Specifies configurations for building multiple APKs or APK splits.

TestCoverage

Configure the gathering of code-coverage from tests.

TestOptions

Specifies options for how the Android plugin should run local and instrumented tests.

ViewBinding

Specifies options for the View Binding Library.

From com.android.build.api.dsl.TestedExtension
String

Specifies the build type that the plugin should use to test the module.

TestFixtures

Options to configure the test fixtures.

String?

The namespace used by the android test and unit test components for the generated R and BuildConfig classes.

Public functions

bundle

Added in 4.2.0
fun bundle(action: Bundle.() -> Unit): Unit

dependenciesInfo

Added in 4.2.0
fun dependenciesInfo(action: DependenciesInfo.() -> Unit): Unit

Specify whether to include SDK dependency information in APKs and Bundles.

privacySandbox

Added in 8.3.1
fun privacySandbox(action: PrivacySandbox.() -> Unit): Unit

publishing

Added in 7.1.0
fun publishing(action: ApplicationPublishing.() -> Unit): Unit

Customizes publishing build variant artifacts from app module to a Maven repository.

For more information about the properties you can configure in this block, see ApplicationPublishing

Public properties

androidResources

Added in 8.9.0-alpha04
val androidResourcesApplicationAndroidResources

Specifies options related to the processing of Android Resources.

For more information about the properties you can configure in this block, see AndroidResources.

assetPacks

Added in 4.2.0
val assetPacksMutableSet<String>

Set of asset pack subprojects to be included in the app's bundle.

bundle

Added in 4.2.0
val bundleBundle

dependenciesInfo

Added in 4.2.0
val dependenciesInfoDependenciesInfo

Specify whether to include SDK dependency information in APKs and Bundles.

dynamicFeatures

Added in 4.2.0
val dynamicFeaturesMutableSet<String>

installation

Added in 8.9.0-alpha04
val installationApplicationInstallation

Specifies options for the Android Debug Bridge (ADB), such as APK installation options.

For more information about the properties you can configure in this block, see AdbOptions.

privacySandbox

Added in 8.3.1
val privacySandboxPrivacySandbox

Options related to the consumption of privacy sandbox libraries

publishing

Added in 7.1.0
val publishingApplicationPublishing

Customizes publishing build variant artifacts from app module to a Maven repository.

For more information about the properties you can configure in this block, see ApplicationPublishing