You can generate, code sign and deploy multiple flavor (multi-flavor) APKs in one workflow using our
Gradle Runner Step. Flavor means enhancing an app’s core code with features resulting in different versions of the same app (just to mention the most common examples: free/paid, demo/full). Check out the official Android Studio guide on build types, flavors and build variants for more info! In this tutorial, you will need to do some settings to
Android Sign and
Google Play Deploy Steps - so keep your eyes peeled!
Generating multi-flavor APKs ⚓
If you have an Android deploy workflow at hand, do the following:
Gradle RunnerStep after the Android testing steps.
Android Buildstep can only build one variant so if this Step is part of your workflow, then we advise you to replace it with our
- Click the
Configsection of the Step.
assembleGradle tasks by adding your build variants’ task names in the
Gradle task to runStep input field - as many task names as many build variants you want to build in one workflow. Each task name must be exactly the same build variant name what you have listed in the
Build Variantwindow of Android Studio! Make sure you separate them only with a space, no need for
,! In the below image, you can see the order of the Steps for the deploy workflow and the
Gradle Task to runStep input with two build variants:
Gradle Runnergenerates a
$BITRISE_APK_PATH_LISTenv var output that contains ALL the build variants you have set in
Gradle task to runStep above. We will need this output env var later!
Signing and deploying multi-flavor APKs ⚓
- Add one
Android SignStep AFTER the
Gradle RunnerStep if it’s missing from your workflow.
- Set the
apk pathinput field which will make sure all the required APKs will get code signed with the keystore file you uploaded to the
Code Signingtab. Check out how you can upload your keystore file to bitrise.io. The Step will export a
$BITRISE_SIGNED_APK_PATHenv var output which lists all your signed build variants.
- Make sure you set the following input fields in the
- Add the
Google Play DeployStep AFTER the
- Set the
$BITRISE_SIGNED_APK_PATHenv var in the
APK or App Bundle file pathStep input field so that
Google Play Deploycan release all your build variants to the app store.
You can manually specify the code signing configuration in your Gradle configuration so that your app gets signed during the build process.
If the file path of your keystore file is defined in your build.gradle file but the keystore file itself is missing from the location where the path points to, you...
Find out how you can deploy the APK built from your Android app to both bitrise.io and to the Google Play Store. Learn about Google Play API access and the...