Skip to main content

(Android) Deploy to Google Play (Internal, Alpha, Beta, Production)

Description

Build an Android app and upload to Google Play to internal, alpha, beta or production track.

Prerequisites

Instructions

  1. (Optional) Add the Change Android versionCode and versionName Step. Set the input variables:

    • Path to the build.gradle file: The default value is $PROJECT_LOCATION/$MODULE/build.gradle and in most cases you don't have to change it.

    • New versionName: for example, 1.0.1

    • New versionCode: for example, 42.

  2. Add the Android Build Step and set the following inputs:

    • Build type: Set this to aab.

    • Variant: Use release, debug, or one of your custom variants if you have any.

    • Module: for example $MODULE.

  3. Add the Android Sign Step.

  4. Add the Google Play Deploy Step and set the following inputs:

    • Service Account JSON key file path: $BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL.

    • Package name: for example, com.your.package.name.

    • Track: Choose one of internal, alpha, beta, or production.

    • Status: The status of a release. For more information, see the Google API reference. Recommended draft for production and completed for internal test builds.

    • Check the other options in the Workflow Editor or in the Step documentation.

    Deploy to Google Play fails with Error 403

    You might experience that Deploy to Google Play Step fails with error:

     "error: Failed to perform edit insert call, error: googleapi: Error 403: The caller does not have permission, forbidden"

    For possible solutions, check out our Knowledge Base article.

bitrise.yml

- change-android-versioncode-and-versionname@1:
    inputs:
    - new_version_name: 1.0.1
    - new_version_code: '42'
    - build_gradle_path: "$PROJECT_LOCATION/$MODULE/build.gradle"
- android-build@1:
    inputs:
    - project_location: "$PROJECT_LOCATION"
    - module: "$MODULE"
    - build_type: aab
    - variant: release
- sign-apk@1: {}
- google-play-deploy@3:
    inputs:
    - service_account_json_key_path: "$BITRISEIO_SERVICE_ACCOUNT_JSON_KEY_URL"
    - package_name: io.bitrise.sample.android
    - status: completed
    - track: internal