2

we have an pretty big application, with a google map as the main activity, in the release mode and the debug mode it's working fine, but after publishing throgh play store, the map did not show anything but the google logo at the left bottom corner. the problem is the same at other applicaition we published to the play store. it is as simple as a one map activity application.

  1. it has two separate google_maps_api.xml files one in src/debug/values the other in src/release/values. Both auto generated by google's map template.
  2. the file in src/debug/values has the sha1 commented inside it. which i used to restrict the debug api key. like here. i then wrote the key inside the google_maps_api.xml in src/debug/values.
  3. then using Build>Generate Singed Apk i created a new key store, with the alias and the passwords. then i created a signed apk. app-release.apk
  4. I've checked AndroidManifest.xml. it calls the google maps key from the respective build variant.
  5. then using the keystore with this command keytool -list -v -keystore mystore.keystore i generated the sha1 and created a new google maps key at the console, with this new sha1 and the same package name.

i did the configurations to enable the release mode inside Build Variants, then i've tried both modes. it's working fine when i run it with android studio. but after uploading it to the market, i downloaded the market version to be surprised with a gray screen, no map!

other questions here where mostly talking about the map not showing at the release mode. i couldn't find any source talking about the problem after publishing, while working fine at the release mode.

things we tried:

  • tried using two diffirent gmail accounts to generate the keys.
  • tried uploading the files using two diffrent accounts.
  • tried to do the whole thing from the start

i followed this doc: https://developers.google.com/maps/documentation/android-api/signup

any ideas or if you can see any flaws in our way, it will be helpful.

Daniel Nugent
  • 43,104
  • 15
  • 109
  • 137
Anan Raddad
  • 195
  • 2
  • 7

2 Answers2

3

If you use Google Play App Signing, you'll need to get the SHA-1 fingerprint that the Google Play Store is using, and use that to properly configure the appropriate API key in the developer console.

From the documentation:

If your app uses any API, you will usually need to register the certificate of the key Google signs your app with for authentication purposes. This is usually done through the fingerprint of the certificate.

To find the certificate of the key Google uses to re-sign your APK for delivery:

  1. Sign in to your Play Console.
  2. Select an app.
  3. On the left menu, click Release management > App signing.
  4. From this page, you can copy the most common fingerprints (MD5, SHA-1 and SHA-256) of your app signing certificate. If the API provider requires a different type of fingerprint, you can also download the original certificate in DER format and run it through the transformation tools that the API provider requires.
Daniel Nugent
  • 43,104
  • 15
  • 109
  • 137
1

In order to have your Google Maps based app running you have to register your work at Google Developers, then you get your own key to use in your maps-apps. Follow this to know the whole process: https://developers.google.com/maps/documentation/android-api/signup

Best.

statosdotcom
  • 3,109
  • 2
  • 17
  • 40