Stay organized with collections
Save and categorize content based on your preferences.
ApplicationBuildType
interface ApplicationBuildType : BuildType, ApplicationVariantDimension
Build types define certain properties that Gradle uses when building and packaging your app, and are typically configured for different stages of your development lifecycle.
There are two build types defined by default, debug
and release
, and you can customize them and create additional build types.
The default debug build type enables debug options and signs the APK with the debug key, while the release build type is not debuggable and can be configured to shrink, obfuscate, and sign your APK with a release key for distribution.
See configuring build types for more information.
Summary
Public properties |
Boolean? |
Whether to crunch PNGs.
|
Boolean |
Whether this build type should generate a debuggable apk.
|
Boolean |
Whether this product flavor should be selected in Studio by default
|
Boolean |
Whether a linked Android Wear app should be embedded in variant using this build type.
|
Boolean |
Intended to produce an APK that leads to more accurate profiling.
|
Inherited functions |
From class com.android.build.api.dsl.BuildType
Unit |
Copies all properties from the given build type.
|
@Incubating Unit |
|
Unit |
This function is deprecated. Replaced with property matchingFallbacks
|
Unit |
This function is deprecated. Replaced with property matchingFallbacks
|
|
From class org.gradle.api.plugins.ExtensionAware
|
From class org.gradle.api.Named
|
From class com.android.build.api.dsl.VariantDimension
Unit |
Adds manifest placeholders.
|
Unit |
Adds a new field to the generated BuildConfig class.
|
@Incubating Unit |
Encapsulates per-variant CMake and ndk-build configurations for your external native build.
|
Unit |
Options for configuring Java compilation.
|
Unit |
Encapsulates per-variant configurations for the NDK, such as ABI filters.
|
@Incubating Unit |
|
Any |
Adds a new ProGuard configuration file.
|
Any |
Adds new ProGuard configuration files.
|
Unit |
Adds a new generated resource.
|
Void? |
This function is deprecated. Use manifestPlaceholders property instead
|
Any |
Replaces the ProGuard configuration files.
|
Unit |
Configure the shader compiler options.
|
Any |
Adds a proguard rule file to be used when processing test code.
|
Any |
Adds proguard rule files to be used when processing test code.
|
|
Inherited properties |
From class com.android.build.api.dsl.ApplicationVariantDimension
String? |
Application id suffix.
|
Boolean? |
Returns whether multi-dex is enabled.
|
ApkSigningConfig? |
The associated signing config or null if none are set on the variant dimension.
|
String? |
Version name suffix.
|
|
From class com.android.build.api.dsl.BuildType
Boolean |
Specifies code coverage is enabled for module tests of type AndroidTest.
|
Boolean |
Specifies unit test code coverage data collection by configuring the JacocoPlugin.
|
Boolean |
Whether this build type is configured to generate an APK with debuggable native code.
|
Boolean |
Specifies whether to enable code shrinking for this build type.
|
Boolean |
Specifies whether the plugin should generate resources for pseudolocales.
|
Boolean |
This property is deprecated. This dsl option has no effect and will be removed in AGP 9.0
|
Boolean |
Specifies whether to enable shrinking resources for this build type.
|
Boolean |
This property is deprecated. Replaced with: enableUnitTestCoverage and or enableAndroidTestCoverage.
|
Boolean |
This property is deprecated. Changing the value of isZipAlignEnabled no longer has any effect
|
MutableList<String> |
Specifies a sorted list of build types that the plugin should try to use when a direct variant match with a local module dependency is not possible.
|
PostProcessing |
|
Int |
Optimization level to use by the renderscript compiler.
|
|
From class com.android.build.api.dsl.VariantDimension
ExternalNativeBuildFlags |
Encapsulates per-variant CMake and ndk-build configurations for your external native build.
|
JavaCompileOptions |
Options for configuring Java compilation.
|
MutableMap<String, Any> |
The manifest placeholders.
|
File? |
This property is deprecated. This property is deprecated.
|
File? |
Text file with additional ProGuard rules to be used to determine which classes are compiled into the main dex file.
|
Ndk |
Encapsulates per-variant configurations for the NDK, such as ABI filters.
|
Optimization |
|
MutableList<File> |
Specifies the ProGuard configuration files that the plugin should use.
|
Shaders |
Options for configuring the shader compiler.
|
MutableList<File> |
The collection of proguard rule files to be used when processing test code.
|
|
Public properties
isCrunchPngs
var isCrunchPngs: Boolean?
Whether to crunch PNGs.
Setting this property to true
reduces of PNG resources that are not already optimally compressed. However, this process increases build times.
PNG crunching is enabled by default in the release build type and disabled by default in the debug build type.
isDebuggable
var isDebuggable: Boolean
Whether this build type should generate a debuggable apk.
isDefault
var isDefault: Boolean
Whether this product flavor should be selected in Studio by default
isEmbedMicroApp
var isEmbedMicroApp: Boolean
Whether a linked Android Wear app should be embedded in variant using this build type.
Wear apps can be linked with the following code:
dependencies {
freeWearApp project(:wear:free') // applies to variant using the free flavor
wearApp project(':wear:base') // applies to all other variants
}
isProfileable
var isProfileable: Boolean
Intended to produce an APK that leads to more accurate profiling.
Enabling this option will declare the application as profileable in the AndroidManifest.
Profileable build types will be signed with the default debug signing config if no other signing config is specified.
This option doesn't make sense to combine with isDebuggable=true. If a build type is set to be both debuggable and profileable the build system will log a warning.
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."],[],[]]