← All integrations
Google Maps

Google Maps

Show interactive maps in your Android app with your own Google Maps key.

Official Google Maps docs

Why a Google Maps key?

On Android, the maps in your app are drawn by Google Maps. Google requires each app to use its own Google Maps key. Without it, your Android app closes as soon as a screen with a map opens.

On iPhone, maps use Apple Maps: no key needed, nothing to do.

Where your key is used, and where it is not

  • The Bloxks preview shows a substitute map. It always works, so it does not prove your Android key is right.
  • Expo Go does not use your key either.
  • The version installed from Google Play is the only real test: that is where your key is used.

Is it free?

Google asks for a billing account on your Google Cloud project, even to show maps. According to Google’s pricing, showing maps in an Android app (Maps SDK for Android) is not billed and has no usage limit. Other Google services, like place search or directions, are billed separately. Check the official pricing before you start.

Step 1: create the key in Google Cloud

  1. Open the Google Cloud console. At the top of the page, open the project selector, then pick a project or create a new one.
  2. Enable billing on this project: open Billing and link a billing account. Google requires it.
  3. Enable the API: open Maps SDK for Android and click Enable.
  4. Open APIs & Services → Credentials, then click Create credentials → API key. Google shows your new key: it starts with AIza….

Step 2: restrict the key to your app

A restricted key only works in your app, even if someone copies it. Open your key (click its name in Credentials), then:

  1. Under Application restrictions, choose Android apps, then click Add.
  2. Package name: type your app’s package name, for example com.yourname.app. It must be exactly the one shown in Publish in Bloxks.
  3. SHA-1 certificate fingerprint: copy it from Play Console. Open your app, then Test and release → App integrity, then the App signing section. Copy the SHA-1 of the App signing key certificate, not the one of the upload key. Menu names can vary a bit from one account to another.
  4. Under API restrictions, choose Restrict key, then tick only Maps SDK for Android.
  5. Click Save.

One key can list several apps: click Add again for each app, with its own package name and SHA-1.

Step 3: add the key in Bloxks

  1. In Bloxks, open Connections, pick Google Maps, then click Add connection.
  2. Paste your key (it starts with AIza…) and validate.
  3. Publish your app on Android again. The key is built into your app when it is compiled: a version already installed on a phone does not change.

Troubleshooting

  • The Android app closes when a map opens: the key is missing. Add it in Connections → Google Maps, then publish again.
  • The map stays grey or blank in the Google Play version: one of these is usually the cause:
    • the SHA-1 or the package name in Google Cloud doesn’t match your app (check that you copied the app signing key, not the upload key);
    • Maps SDK for Android is not enabled on the project;
    • billing is not enabled on the project.
  • You just changed something in Google Cloud: changes can take a few minutes to apply. Wait, then reopen the app.
  • The map works in the Bloxks preview but not on the phone: that’s normal, the preview uses a substitute map. Only the Google Play version tells you if your key works.

Want to go deeper? Read the official Google guide.

Go further

The pages of this documentation that use Google Maps.

Frequently asked questions

No. On iPhone, maps use Apple Maps, which needs no key. The Google Maps key is only for Android.

The key is built into the app when it is compiled. Publish your app on Android again, then install the new version from Google Play.

The one of the app signing key certificate, in Play Console under App integrity. Not the upload key: Google signs the version people install with the app signing key.

Yes. In the key’s Android restrictions, add one line per app, each with its own package name and SHA-1.