ApplicationPublishing

interface ApplicationPublishing : Publishing


Maven publishing DSL object for configuring options related to publishing APK and AAB.

This following code example creates a publication for the fullRelease build variant, which publish your app as Android App Bundle.

android {
// This project has four build variants: fullDebug, fullRelease, demoDebug, demoRelease
flavorDimensions 'mode'
productFlavors {
full {}
demo {}
}

publishing {
// Publish your app as an AAB
singleVariant("fullRelease")
}
}

afterEvaluate {
publishing {
publications {
fullRelease(MavenPublication) {
from components.fullRelease
// ......
}
}
}
}

To publish your app as a ZIP file of APKs, simply use the ApplicationSingleVariant.publishApk as shown in the following example.

android {
publishing {
// Publish your app as a ZIP file of APKs
singleVariant("fullRelease") {
publishApk()
}
}
}

Summary

Inherited functions

From class com.android.build.api.dsl.Publishing
Unit
singleVariant(variantName: String)

Publish a variant with single variant publishing mechanism.

Unit
singleVariant(
    variantName: String,
    action: @ExtensionFunctionType ApplicationSingleVariant.() -> Unit
)

Publish a variant with single variant publishing options.