ApplicationBuildType

interface ApplicationBuildType : VariantDimension, HasInitWith, BuildType, VariantDimension, 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 BuildType
@Incubating Unit

Copies all properties from the given build type.

@Incubating Unit
@Incubating Unit

This function is deprecated. Replaced with property matchingFallbacks

@Incubating Unit
setMatchingFallbacks(vararg fallbacks: String?)

This function is deprecated. Replaced with property matchingFallbacks

From class ExtensionAware
From class Named
From class VariantDimension
@Incubating Unit
addManifestPlaceholders(manifestPlaceholders: Map<String?, Any?>?)

Adds manifest placeholders.

@Incubating Unit
buildConfigField(type: String?, name: String?, value: String?)

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.

@Incubating Unit
ndk(action: (@ExtensionFunctionType Ndk.() -> Unit)?)

Encapsulates per-variant configurations for the NDK, such as ABI filters.

@Incubating Unit
@Incubating Any
proguardFile(proguardFile: Any?)

Adds a new ProGuard configuration file.

@Incubating Any
proguardFiles(vararg files: Any?)

Adds new ProGuard configuration files.

@Incubating Unit
resValue(type: String?, name: String?, value: String?)

Adds a new generated resource.

@Incubating Void?
setManifestPlaceholders(manifestPlaceholders: Map<String?, Any?>?)

This function is deprecated. Use manifestPlaceholders property instead

@Incubating Any
setProguardFiles(proguardFileIterable: Iterable<*>?)

Replaces the ProGuard configuration files.

@Incubating Unit

Configure the shader compiler options.

@Incubating Any
testProguardFile(proguardFile: Any?)

Adds a proguard rule file to be used when processing test code.

@Incubating Any
testProguardFiles(vararg proguardFiles: Any?)

Adds proguard rule files to be used when processing test code.

Public properties

isCrunchPngs

val isCrunchPngsBoolean?

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

val isDebuggableBoolean

Whether this build type should generate a debuggable apk.

isDefault

val isDefaultBoolean

Whether this product flavor should be selected in Studio by default

isEmbedMicroApp

val isEmbedMicroAppBoolean

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

val isProfileableBoolean

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.