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:
Update the release google_maps_api.xml with the API key (not just the debug file, so 2 files must be updated)
Update Google Cloud API Credentials (not sure if optional if an app does not need Restrictions?)
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.
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.
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?
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.