1

When I download my app from google play the Google Map is no loaded. When I download the app with the .apk file directly (transfer it to my phone and downloading) it did load! I searched all over and it still doesn't work. This is what I did:

  1. In Android studio, Build->Generate Sign APK I created a new Keystore 'keystore' and a new Key 'app'
  2. run: keytool -list -v -keystore keystore.jks -alias app.
  3. In the output from step 2, under 'Certificate fingerprints:' I took the 'SHA1' value and my package name 'com.gilshelef.feedme' (from AndroidManifest.xml file) and generated a new API key in the Google api console. I restricted the key to 'android apps' and added my SHA1 and package name.
  4. I placed the generated key (step 3) in my Manifest file:

    <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_maps_key" />

  5. In android studio, Build->generate sign APK I used the same keystore that I created in step 1 and the same key.

  6. I uploaded the generated apk to Google play.

After I downloaded my app from google play the map is still blank!

NOTES:

  1. I also tried to changed the extension of the keystore from .jks to .keystore since android studio uses the .jks extension.
  2. I verified that the key from google api console and the one Im using in my AndroidManifest.xml file is the same.
  3. I verified the package name in google api console and Manifest file.
  4. I followed this: this tutorial 'Displaying the release certificate fingerprint'. The output looks the same except for the 'Signature algorithm name: SHA1withRSA'. the signature algorithm name in my release keystore is 'SHA256withRSA' maybe this is the problem?

What am I doing wrong??

gil shelef
  • 67
  • 1
  • 1
  • 3
  • i encountered the same issue. the solution is found here https://stackoverflow.com/questions/46191073/google-maps-not-showing-after-uploading-the-app-to-playstore – Zandro Zulueta Jan 26 '19 at 15:57

1 Answers1

0

Its because of google_maps_key is different in release mode from the one in debug mode. when you sign your app the release version is made then you can do following:

  1. Find release SHA-1 fingerprint (here)
  2. Get another api_key for google maps api from google
  3. Put the new api_key in src/release/values/google_maps_api.xml (In Project View) or (app/res/values/google_maps_api.xml(release) in Android View)

hope it helps you...

Community
  • 1
  • 1
Navid
  • 595
  • 5
  • 18
  • This is exactly what I did...as described in the steps. I took the SHA1 fingerprint from the release keystore with keytool. Created new api key with google api console and added that key to my release google_maps_api.xml... – gil shelef Jun 10 '17 at 10:04
  • The SHA1 fingerprint I took from the 'keystore.jks' generated at step 1 through android studio. I used the keytool with the command in step 2. – gil shelef Jun 10 '17 at 10:49
  • I swear it wasn't in your question :o ! but I put the release key in the res/release/values/google_maps_api.xml and not directly in manifest file. – Navid Jun 10 '17 at 10:49
  • I tried that as well... =\ As you can see in step 4 the value for the TAG is @string/google_maps_key which is actually the file in res/release/values/google_maps_api.xml – gil shelef Jun 10 '17 at 11:03
  • is your debug api_key is different from release api_key? – Navid Jun 11 '17 at 09:05
  • yes, I generated a new key in the google api console for the release keystore and placed it in my Manifest – gil shelef Jun 21 '17 at 11:13