ApplicationExtension

public interface ApplicationExtension extends 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 methods

abstract void
bundle(
    @ExtensionFunctionType @NonNull Function1<@NonNull BundleUnit> action
)
abstract void

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

abstract @NonNull ApplicationAndroidResources

Specifies options related to the processing of Android Resources.

abstract @NonNull Set<@NonNull String>

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

abstract @NonNull Bundle
abstract @NonNull DependenciesInfo

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

abstract @NonNull Set<@NonNull String>
abstract @NonNull ApplicationPublishing

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

abstract void

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

Inherited methods

From com.android.build.api.dsl.CommonExtension
abstract void

This method is deprecated. Replaced by

abstract void

This method is deprecated. Replaced by installation

abstract void

Specifies options related to the processing of Android Resources.

abstract void

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

abstract void
buildToolsVersion(@NonNull String buildToolsVersion)

This method is deprecated. Replaced by buildToolsVersion property

abstract void

Encapsulates all build type configurations for this project.

abstract void

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

abstract void
compileSdkAddon(@NonNull String vendor, @NonNull String name, int version)

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

abstract void
compileSdkVersion(int apiLevel)

This method is deprecated. Replaced by compileSdk

abstract void

This method is deprecated. Replaced by compileSdkPreview

abstract void
abstract void

Specifies options for the Data Binding Library.

abstract void

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

abstract void

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

abstract void

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

abstract void

This method is deprecated. Replaced by flavorDimensions property

abstract @NonNull AaptOptions

Specifies options for the Android Asset Packaging Tool (AAPT).

abstract @NonNull AdbOptions

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

abstract @NonNull ApplicationBuildFeatures

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

abstract @NonNull String

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

abstract @NonNull NamedDomainObjectContainer<@NonNull ApplicationBuildType>

Encapsulates all build type configurations for this project.

abstract @NonNull CompileOptions

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

abstract Integer

Specifies the API level to compile your project against.

abstract Integer

Specifies the SDK Extension level to compile your project against.

abstract String

Specify a preview API to compile your project against.

abstract @NonNull ComposeOptions
abstract @NonNull DataBinding

Specifies options for the Data Binding Library.

abstract @NonNull ApplicationDefaultConfig

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

abstract @NonNull File
abstract @NonNull Map<@NonNull String, @NonNull Object>

Additional per module experimental properties.

abstract @NonNull ExternalNativeBuild

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

abstract @NonNull List<@NonNull String>

Specifies the names of product flavor dimensions for this project.

abstract @NonNull Installation

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

abstract @NonNull JacocoOptions

Configure the gathering of code-coverage from tests.

abstract @NonNull Lint

Specifies options for the lint tool.

abstract @NonNull LintOptions

Specifies options for the lint tool.

abstract String

The namespace of the generated R and BuildConfig classes.

abstract String

Requires the specified path to NDK be used.

abstract @NonNull String

Requires the specified NDK version to be used.

abstract @NonNull Packaging

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

abstract @NonNull Packaging

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

abstract @NonNull NamedDomainObjectContainer<@NonNull ApplicationProductFlavor>

Encapsulates all product flavors configurations for this project.

abstract String

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

abstract @NonNull SdkComponents
abstract @NonNull NamedDomainObjectContainer<@NonNull ApkSigningConfig>

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

abstract @NonNull NamedDomainObjectContainer<@NonNull AndroidSourceSet>

Encapsulates source set configurations for all variants.

abstract @NonNull Splits

Specifies configurations for building multiple APKs or APK splits.

abstract @NonNull TestCoverage

Configure the gathering of code-coverage from tests.

abstract @NonNull TestOptions

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

abstract @NonNull ViewBinding

Specifies options for the View Binding Library.

abstract void

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

abstract void

This method is deprecated. Renamed to testCoverage

abstract void

Specifies options for the lint tool.

abstract void

This method is deprecated. Renamed to lint

abstract void
packaging(
    @ExtensionFunctionType @NonNull Function1<@NonNull PackagingUnit> action
)

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

abstract void

This method is deprecated. Renamed to packaging

abstract void

Encapsulates all product flavors configurations for this project.

abstract void

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

abstract void
setBuildToolsVersion(@NonNull String buildToolsVersion)

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

abstract void
setCompileSdk(Integer compileSdk)

Specifies the API level to compile your project against.

abstract void
setCompileSdkExtension(Integer compileSdkExtension)

Specifies the SDK Extension level to compile your project against.

abstract void
setCompileSdkPreview(String compileSdkPreview)

Specify a preview API to compile your project against.

abstract void
setNamespace(String namespace)

The namespace of the generated R and BuildConfig classes.

abstract void
setNdkPath(String ndkPath)

Requires the specified path to NDK be used.

abstract void

Requires the specified NDK version to be used.

abstract void
setResourcePrefix(String resourcePrefix)

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

abstract void

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

abstract void

Encapsulates source set configurations for all variants.

abstract void
splits(
    @ExtensionFunctionType @NonNull Function1<@NonNull SplitsUnit> action
)

Specifies configurations for building multiple APKs or APK splits.

abstract void

Configure the gathering of code-coverage from tests.

abstract void

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

abstract void

Includes the specified library to the classpath.

abstract void
useLibrary(@NonNull String name, boolean required)

Includes the specified library to the classpath.

abstract void

Specifies options for the View Binding Library.

From com.android.build.api.dsl.TestedExtension
abstract @NonNull String

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

abstract @NonNull TestFixtures

Options to configure the test fixtures.

abstract String

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

abstract void

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

abstract void
setTestNamespace(String testNamespace)

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

abstract void

Options to configure the test fixtures.

Public methods

bundle

abstract void bundle(
    @ExtensionFunctionType @NonNull Function1<@NonNull BundleUnit> action
)

dependenciesInfo

abstract void dependenciesInfo(
    @ExtensionFunctionType @NonNull Function1<@NonNull DependenciesInfoUnit> action
)

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

getAndroidResources

abstract @NonNull ApplicationAndroidResources getAndroidResources()

Specifies options related to the processing of Android Resources.

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

getAssetPacks

abstract @NonNull Set<@NonNull StringgetAssetPacks()

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

getBundle

abstract @NonNull Bundle getBundle()

getDependenciesInfo

abstract @NonNull DependenciesInfo getDependenciesInfo()

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

getDynamicFeatures

abstract @NonNull Set<@NonNull StringgetDynamicFeatures()

getPublishing

abstract @NonNull ApplicationPublishing getPublishing()

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

publishing

abstract void publishing(
    @ExtensionFunctionType @NonNull Function1<@NonNull ApplicationPublishingUnit> action
)

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