1

i'm using the google maps plugin for flutter https://pub.dartlang.org/packages/google_maps_flutter

debug mode works fine but in release the map is not showing and nothing is crashing.

i added the SHA1 of the release key to the api console and updated the api key and still the same thing!

Amr Ahmed
  • 203
  • 3
  • 12

2 Answers2

1

Is the map not working after uploading the app to the Play Store? Or just testing the Release APK?

If the issue only happens when testing the Release APK locally (whether on an emulator or local device), you want to make sure you get the SHA1 fingerprint of the release certificate, as this is a different SHA1 fingerprint that Android Studio uses in Debug mode.

You can find the SHA1 you need to use by running the keytool command[1] on your keystore and key alias:

keytool -list -v -keystore your_keystore_name -alias your_alias_name

***As a note, you can also add multiple Package Name + SHA1 restrictions to a single API Key, so you should have one for your debug certificate and one for your release certificate added in the Cloud Console.

[1] https://developers.google.com/maps/documentation/android-sdk/signup#release-cert

  • i checked the SHA1 data and it's all ok.. the problem is the map is working on some devices on some not so i figured out that the issue here is the play services i think, and i want to check in my app is the map going to work or not to put some alternative screens – Amr Ahmed Apr 11 '19 at 19:39
  • That certainly is possible! You may find the last few paragraphs in this documentation helpful to run for checks and conditions related to Play Service dependencies: https://developers.google.com/android/guides/setup – Adam Kuehling Apr 11 '19 at 20:34
1

The problem is that you use SHA1 that generated from Android studio but it is just for debug mode, So to make it work on release mode Just follow these steps.

  1. Run this command :

    keytool -list -v -keystore your_keystore_name -alias your_alias_name

  2. And it will generate SHA1 Key generate SHA1 Key

  3. Just copy this SHA1 Key and paste it in your credential page add SHA1 to google maps

  4. Finally click save and you did it ^_^

  • Upload the app. Then this is also visible in the google play console under `App Integrity` -> `Upload Key Certificate` -> `SHA-1 certificate fingerprint`. – Yoosu Jun 15 '23 at 01:35