ApplicationPublishing

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

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

Publish a variant with single variant publishing mechanism.

abstract void
singleVariant(
    @NonNull String variantName,
    @ExtensionFunctionType @NonNull Function1<@NonNull ApplicationSingleVariantUnit> action
)

Publish a variant with single variant publishing options.