VoltBuilder can automatically upload your app to the Google Play Store at the end of your build. Uploaded apps are eligible for test or release.

There are a few additional setup steps to do in Google Play, but they only have to be done once.

Here’s how it works.

Set up your app in the Google Play Store

  1. Set it up as a normal listing. You can use an existing app already in the store.

Get Google API Credentials

Tip: If you see Google Play Console or Google Developer Console in your local language, add &hl=en at the end of the URL (before any #…) to switch to English.

  1. Open the Google Play Console, All Apps view.
  2. Click the Settings menu entry, followed Developer Account, then by API access.
  3. Click on Link Existing Project, then Google Play Android Developer.
  4. Click on Link Project.
    API Access

  5. Agree to Terms of Service (if needed)
  6. Click Create new service account (It’s about halfway down the page and not highlighted). It will tell you to go to Google Cloud Platform. Go there.
    1. Click the CREATE SERVICE ACCOUNT button at the top of the Google Developers Console
    2. For Service account name, enter VoltBuilder
    3. For Service account description, enter VoltBuilder API access
    4. Click on Create
    5. For role, choose Service Accounts > Service Account User.
    6. Click on Continue
    7. Click on Done
    8. A table with display with your new entry. Under Actions, choose Create key
    9. A dialog box will appear Create private key for “VoltBuilder”. Select JSON as the Key type.
    10. Click CREATE to close the dialog and download the file. Save it to your project’s Certificates folder.
    11. Make a note of the file name of the JSON file downloaded to your computer. It will be something like api-8264238403641545035-843025-f2f055a01404.json (You can name it something else if you want: google.json is a good name.)
  7. Back on the Google Play Console, click DONE to close the dialog
  8. Click on Grant Access for the newly added service account
  9. You will now be on the Invite user page. Check that only the items in the Releases section are checked.
  10. Click on Invite user
  11. Click on Send invite
  12. You should now see your new user:
    Users and Permissions

Add App Permissions to the Credentials

  1. Get to the Users and Permissions screen in the Google Play Console.
  2. Click on your new user (voltbuilder@…)
  3. App Permissions will show. Select Add app
  4. Select your app and Apply
  5. Save changes
    Add App

Tell VoltBuilder about it

  1. VoltBuilder.json: Add these lines to your voltbuilder.json (substitute your values).
      "googlePlayKey": "certificates/google.json",
      "googlePlayTrack": "production",
    

    Valid values for googlePlayTrack include production, internal, alpha, and beta.

  2. Build Number: Each time you run, make sure android-versionCode has been incremented in config.xml. <widget android-versionCode="2" version="1.0.0" ...

Do a release build as usual. If the upload fails, VoltBuilder will return a message. Otherwise, your app will have been uploaded to the Google Play Store.

Refreshing your Credentials

If you get the message 'invalid_grant: Invalid JWT Signature.', you need to refresh your google.json file.

  1. Open the Google Play Console, All Apps view.
  2. Click the Settings menu entry, followed Developer Account, then by API access.
  3. Under Service accounts, click on View in Google Cloud Console
  4. Under Actions, choose Create key.
  5. A dialog box will appear Create private key for “VoltBuilder”. Select JSON as the Key type.
  6. Click CREATE to close the dialog and download the file. Save it to your project’s Certificates folder.
  7. Make a note of the file name of the JSON file downloaded to your computer. It will be something like api-8264238403641545035-843025-f2f055a01404.json (You can name it something else if you want: google.json is a good name.)