> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reyapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload a Google Service Account Key for Play Store Publishing

> Create a Google Cloud service account, grant it Play Console access, download the JSON key, and upload it to Rey so you can publish Android apps to Google Play.

To publish and update your Rey app on Google Play, Rey needs permission to submit builds on your behalf. Google grants this permission through a **service account** — a special Google Cloud identity with a JSON key file that acts like a password. Once you upload the key to Rey, all future Android submissions and updates happen automatically.

You only need to do this **once per Google Play Developer account**.

## Prerequisites

* A [Google Play Developer account](https://play.google.com/console) with the **Admin (all permissions)** role.
* A Google Cloud account (any Google account works — no billing required for this flow).
* Your Rey app ready to publish. See [App Stores](/publishing/app-store) for the full submission overview.

## Step 1: Create a Google Cloud project

<video src="https://mintcdn.com/rey-62fd4809/RjCMwoQAVmJjywMB/Create-a-new-project-in-google-cloud-console.mp4?fit=max&auto=format&n=RjCMwoQAVmJjywMB&q=85&s=d0f4b1c667284980348a8c4e1fab7195" controls data-path="Create-a-new-project-in-google-cloud-console.mp4" />

<Steps>
  <Step title="Open the Google Cloud Console">
    Go to the [Google Cloud Console](https://console.cloud.google.com/).
  </Step>

  <Step title="Create a new project">
    Click the project selector in the top bar, then **New Project**. Name it something recognizable like `rey-play-publishing` and click **Create**.
  </Step>

  <Step title="Select the new project">
    Once created, make sure your new project is selected in the project selector before continuing.
  </Step>
</Steps>

## Step 2: Enable the Google Play Android Developer API

<Steps>
  <Step title="Open the API library">
    In the Cloud Console, navigate to **APIs & Services → Library**.
  </Step>

  <Step title="Search for the API">
    Search for **Google Play Android Developer API**.
  </Step>

  <Step title="Enable it">
    Click the result, then click **Enable**.
  </Step>
</Steps>

## Step 3: Create the service account

<Steps>
  <Step title="Open IAM & Admin">
    In the Cloud Console, go to **IAM & Admin → Service Accounts**.
  </Step>

  <Step title="Create a service account">
    Click **Create Service Account**. Give it a descriptive name like `rey-play-publisher` and click **Create and Continue**.
  </Step>

  <Step title="Grant a role (optional at this step)">
    You can skip granting a Cloud project role here — the required permissions are granted later inside the Play Console. Click **Continue**, then **Done**.
  </Step>
</Steps>

## Step 4: Create and download a JSON key

<Steps>
  <Step title="Open the new service account">
    From the service accounts list, click the account you just created.
  </Step>

  <Step title="Add a key">
    Go to the **Keys** tab, click **Add Key → Create new key**, choose **JSON**, and click **Create**.
  </Step>

  <Step title="Save the JSON file">
    A JSON file downloads to your computer. Store it somewhere safe — you'll upload this file to Rey in the final step.
  </Step>
</Steps>

<Warning>
  Treat this JSON key like a password. Anyone with the file can publish apps to your Google Play account. Do not commit it to source control or share it in chat.
</Warning>

## Step 5: Grant the service account access in Google Play Console

<Steps>
  <Step title="Open the Play Console">
    Go to the [Google Play Console](https://play.google.com/console) and select your developer account.
  </Step>

  <Step title="Open Users and permissions">
    In the left sidebar, click **Users and permissions**, then click **Invite new users**.
  </Step>

  <Step title="Enter the service account email">
    Paste the service account email (it looks like `rey-play-publisher@your-project.iam.gserviceaccount.com`). You can find it back in the Cloud Console service accounts list.
  </Step>

  <Step title="Grant account permissions">
    Under **Account permissions**, enable at minimum:

    * **View app information and download bulk reports**
    * **Manage production releases**
    * **Manage testing track releases**
    * **Manage store presence**
    * **Edit and delete draft apps**
    * **Release apps to testing tracks**
    * **Release to production, exclude devices, and use Play App Signing**

    For the simplest setup, you can grant **Admin (all permissions)**, but least-privilege is recommended.
  </Step>

  <Step title="Invite the user">
    Click **Invite user**, then **Send invitation**. The service account is granted access immediately — no email confirmation needed.
  </Step>
</Steps>

## Step 6: Upload the JSON key to Rey

<Steps>
  <Step title="Open Publish settings">
    In the Rey editor, click **Publish** in the toolbar and select **Google Play** as the target.
  </Step>

  <Step title="Connect your Google Play account">
    In the **Google Play Developer account** section, click **Upload service account key**.
  </Step>

  <Step title="Select your JSON file">
    Choose the JSON key file you downloaded in Step 4. Rey validates the file and confirms the connection.
  </Step>

  <Step title="You're done">
    Rey is now authorized to publish and update this app on Google Play. You can start a submission from the same screen.
  </Step>
</Steps>

<Tip>
  If you rotate or revoke the key later, just repeat Step 4 to generate a new JSON file and re-upload it in Rey. Old keys can be deleted from the Cloud Console service account **Keys** tab.
</Tip>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Rey says the key is invalid">
    Make sure you uploaded the **JSON** key (not a P12) and that the Google Play Android Developer API is enabled in the same Cloud project that owns the service account.
  </Accordion>

  <Accordion title="Submission fails with a permission error">
    The service account is missing a required Play Console permission. Return to **Users and permissions** in the Play Console and confirm every permission listed in Step 5 is enabled for the service account.
  </Accordion>

  <Accordion title="I can't find the service account email">
    In the Cloud Console, go to **IAM & Admin → Service Accounts** and select your project. The email is listed next to each account and always ends in `.iam.gserviceaccount.com`.
  </Accordion>
</AccordionGroup>

## Next Steps

* Return to [App Stores](/publishing/app-store) to complete your Google Play submission.
* Preview your app on a real device first with [Device Preview](/publishing/preview).
