Skip to main content

Android Build

The Appcircle Android Build step is designed to build your Android application for the architectures specified in your project.

Prerequisites

The workflow steps that need to be executed before running the Android Build workflow step, along with their respective reasons, are listed in the table below.

Prerequisite Workflow StepDescription
Git CloneTo initiate the Android build process, the repository that needs to be built must be fetched from the branch. This is achieved as follows: Upon completion of the Git Clone step, it generates the AC_REPOSITORY_DIR variable, which is then used as the input for the Android Build step.

Input Variables

For each component, specific input variables are required for its operation on your system. The input variables necessary for the Android Build are as follows:

Variable NameDescriptionStatus
$AC_REPOSITORY_DIRThis variable represents the path of the cloned Git repository. If this step runs after the Git Clone step, the variable will be automatically populated.Required
$AC_MODULEThis variable specifies the project module to be build. This variable can also be set via the build Configuration. In Android Studio, you can locate the available modules for your project. For more information, please refer to this Android document.Required
$AC_VARIANTSThis variable specifies the project variant to be build. This variable can also be set via the build Configuration. In Android Studio, you can find the available variants for your project. For more information, please refer to this Android document.Required
$AC_OUTPUT_TYPEThis variable specifies the output type for your build file (APK or AAB). This variable can also be set via the build Configuration.Required
$AC_PROJECT_PATHSpecifies the project path. If your project that needs to be built is not located in the root directory where it was cloned from Git, you should provide the subpath as a relative path.Optional
$AC_GRADLE_BUILD_EXTRA_ARGSExtra arguments were passed to build task. For more information, please refer to this Gradle document.Optional
info

If you have filled in the necessary variables in the Configuration section, you will not need to redefine these variables again in the Workflow. For more information about configurations, refer to the Build Profile Configuration Overview document. The information you fill in the configuration will be used as input in the Android Build step. Please replace the example information with your own details:

  1. The input corresponding to the 1st field: $AC_MODULE
  2. The input corresponding to the 2nd field: $AC_VARIANTS
  3. The input corresponding to the 3rd field: $AC_OUTPUT_TYPE
tip

If you are using Gradle 4.3 and above in your project, you can just use the --scan flag in the build step to enable build scans. For existing projects, you may need to add the Gradle Scan (Gradle Enterprise) plugin. For more information, please refer to

Preview of scans.gradle.com

Output Variables

The outputs that can result from the operation of this component are listed as follows:

Variable NameDescription
$AC_APK_PATHPath for the generated APK file. This path will be created after the Android Build step runs.
$AC_AAB_PATHPath for the generated AAB file. This path will be created after the Android Build step runs and when AAB is selected.

The resulting files will be either APK or AAB, depending on whether you choose the Android App in the project Configuration.

If your project has the signing configuration in Gradle, this step will generate a signed artifact.

caution

If you do not disable the Android Sign step and your project has no signing configuration defined in Gradle, your artifact will remain unsigned.

So, in order to sign your app using the keystore selected in the build configuration, you should enable the Android Sign step after Android Build.

To access the source code of this component, please use the following link:

Preview of GitHub - appcircleio/appcircle-android-build-component