Release APK file not showing google maps

2019-02-08 14:41发布

I applied the exact steps as mentioned in the google developer doc to create an example google map project and everything went fine on the emulator, but when I generated the project apk file and launched it on real device Samsung Galaxy S4 google map doesn't show up it shows only a blank background with just colored Google logo appearing on the left lower screen corner !!

I created new project for google map I created new .jks file for the project and created store and key pass and alias then I extracted the SHA1 from cmd java bin I went to dev.google.com/console created new project then enabled google maps android API then created API key from Credentials pasted this API key in place in google_maps_api.xml in my project updated the signingConfigs release with the .jks file path and alias and two passwords. then generated signed APK from Android Studio then transferred the app-release.apk to real device then installed it same problem google map NOT showing.

Plz Help

4条回答
三岁会撩人
2楼-- · 2019-02-08 15:16

If all above cases not working then used below method its work for me. Google play signing enable for this

查看更多
▲ chillily
3楼-- · 2019-02-08 15:26

now google signed apk before publish on store,so go to google pushish app ---> app signning , and add signed key to google developer console,you shoud add 3 key sha1 : debug,release and new sha1 key after pushlish

查看更多
爷、活的狠高调
4楼-- · 2019-02-08 15:30

It might be silly but I had my API key included in

app\src\debug\res\values\google_maps_api.xml (debug)

You also need to include in-

app\src\release\res\values\google_maps_api.xml (release)

查看更多
smile是对你的礼貌
5楼-- · 2019-02-08 15:40

Reason for this issue

This occurred because there are different SHA1s in debug and release types.

Fix for this issue

Add the SHA1 of the keystore used to build the release APK to Google console

Steps:

  1. Get the path of the keystore when you generate signed APK

    Build ----> Generate Signed APK..

Save the key store path

enter image description here

Remember to make Build Type --- release

enter image description here

  1. Extract SHA1 from the keystore.

Open your terminal use command below:

 keytool -list -v -keystore "/Users/NT/Desktop/generalkey.jks"

You will be asked for password for your keystore.

Change path to your keystore path keytool -list -v -keystore "keystore path"

From the Certificate fingerprints, you will see the SHA1

  1. Generate android key using this SHA1 and your package name

enter image description here

Generate APK using keystore and enjoy your map

查看更多
登录 后发表回答