icon

Android Build

Builds your Android project with Gradle.

The Step builds your Android project on Bitrise with Gradle commands: it installs all dependencies that are listed in the project's build.gradle file, and builds and exports either an APK or an AAB. Once the file is exported, it is available for other Steps in your Workflow.

You can select the module and the variant you want to use for the build.

Configuring the Step

  1. Make sure the Project Location input points to the root directory of your Android project.

  2. In the Module input, set the module that you want to build.

    You can find the available modules in Android Studio.

  3. In the Variant input, set the variant that you want to build.

    You can find the available variants in Android Studio.

  4. In the Build type input, select the file type you want to build.

    The options are:

    • apk
    • aab
  5. In the Options input group, you can set more advanced configuration options for the Step:

    • In the App artifact (.apk, .aab) location pattern input, you can tell the Step where to look for the APK or AAB files in your project to export them. For the vast majority of Android projects, the default values do NOT need to be changed.

    • In the Additional Gradle Arguments, you can add additional command line arguments to the Gradle task. Read more about Gradle's Command Line Interface.

    • The Set the level of cache input allows you to set what will be cached during the build: everything, dependencies only, or nothing.

Troubleshooting

Be aware that an APK or AAB built by the Step is still unsigned: code signing is performed either in Gradle itself or by other Steps. To be able to deploy your APK or AAB to an online store, you need code signing.

If you want to build a custom module or variant, always check that the value you set in the respective input is correct. A typo means your build will fail; if the module or variant does not exist in Android Studio, the build will fail.

Useful links

Related Steps

Similar steps

Builds your Android project with Gradle with the belonging AndroidTest variant.

Builds a mobile app using Appdome's platform

The Step runs ionic build with the arguments you provide.

This step allows you to build cordova-based Android projects.