Chapter 13 SHA1 Key for Release Builds?

Chapter 13 P 241 states ‘getting the SHA1 key for release builds will be covered in Section VI, “Submitting Your App”. ‘ However, Section VI does not cover the ‘release’ SHA-1 or API keys for a Google Maps API based app.

I tried the following in the key store folder of my app:
keytool -list -keystore MyAppKeyStore.jks
and got the SHA1 key.

However, it seems to actually release a Google Maps API app thru the Google Play lifecycle, one needs:

  1. Update the release google_maps_api.xml with the API key (not just the debug file, so 2 files must be updated)
  2. Update Google Cloud API Credentials (not sure if optional if an app does not need Restrictions?)
  3. Add a Billing account to the project in Google Cloud.

I set all up, but still the App Release version of the app did not show the map upon launch on a real phone for alpha testing. Only a gray area (though the Search button and all other functions worked fine!).

The book can be significanly beneficial to the apprentices if it completes the Maps project with the needed Cloud/API/Billing setups to actually release it on the Google Play store. Thanks.

@tblank Can you please help with this when you get a chance? Thank you - much appreciated! :]

HI @mazen_kilani,

Thank you for the feedback.

Chapter 30: Preparing for Release goes into detail about creating a signing key for release, but it doesn’t mention how to get the SHA-1 fingerprint from the release keystore. We will look into adding some more detailed instructions to get the SHA-1 fingerprint and some additional instructions for publishing the Placebook app to the play store.

I’m not sure why you were not able to view the map on the release version. I would double check that you have placed the correct Google Maps API key (the one generated from the release SHA-1 key) in the release google_maps_api.xml file, and that you generating a signed version of the app using the release (app store) keystore and alias.

Regards,
Tom

Hi @tblank

I would be most grateful for more details on ‘you have placed the correct Google Maps API key (the one generated from the release SHA-1 key)…’

When I keytool -list -keystore MyAppKeyStore.jks, I only get the SHA-1 , not a new Google Maps API key for release, so I used the debug API.

" Keystore type: jks
Keystore provider: SUN
Your keystore contains 1 entry
8places, 05/02/2019, PrivateKeyEntry,
Certificate fingerprint (SHA1): 33:…"

How exactly do you get the release Google Maps API key from SHA-1?

When one follows: Using API Keys  |  Maps SDK for Android  |  Google Developers
there is no SHA-1 key required when an API is generated. The SHA-1 is added on on the Credentials page (if Restrictions are needed).

Apologies if I missed the obvious here, but would be grateful for more details.

@tblank Do you have any feedback about this? Thank you - much appreciated! :]

Hi @mazen_kilani,

My apologies for the confusion regarding using the SHA-1 key. You are correct, this doesn’t come into play if you are using a google maps API key without restrictions.

I just did some testing with a signed release build and I was able to see the map on my device.

If you create a release build APK using the Build->Generate Bundle(s) / APK(s) option and then install it on your device directly, are you then able to see the map, or is this when you see gray only?

Regards,
Tom

Hi @tblank

The issue is not a connected device (it works fine). You need to go thru the full cycle via the Google Play store. Upload your signed bundle then download to an Alpha Tester physical phone. The Alpha Tester sees only a gray screen. So, Google Cloud/Play Store needs a specific setup (inc. a Billing account for the Map API).

We need someone who actually got the app working via the Google Play Store as an Alpha Tester and understand the steps they went through.