发布APK文件不显示谷歌地图 [英] Release APK file not showing google maps

查看:271
本文介绍了发布APK文件不显示谷歌地图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应用了google开发人员文档中提到的确切步骤来创建示例Google地图项目,并且模拟器上的一切都很顺利,但是当我生成项目apk文件并在真实设备上启动它时,Samsung Galaxy S4 google map doesn 't显示它只显示空白背景,只有彩色的Google徽标出现在屏幕左下角!!

我为Google Map创建了新项目,我创建了新的项目。 jks文件的项目和创建存储和密钥传递和别名然后我提取SHA1从cmd java bin我去dev.google.com/console创建新项目,然后启用谷歌地图android API然后从Credentials创建API密钥粘贴此API我的项目中的google_maps_api.xml中的关键字已更新signedConfigs版本,其中包含.jks文件路径和别名以及两个密码。然后从Android Studio生成签名的APK,然后将app-release.apk转移到真实的设备上,然后安装它同样的问题谷歌地图不显示。


$ b $ p

Plz Help

解决方案


这个问题的原因

为什么会发生这种情况?这是因为调试和发布类型中有不同的SHA1。



我通过将我用过的密钥存储区(用于构建发行版apk)的SHA1添加到Google控制台来解决此问题

p>

这里是接近该步骤的所有步骤。

1-获取密钥库的路径



生成签名的APK时



生成---->生成签名APK。



记住关键商店路径



生成APK使用keystore并享受您的地图

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

解决方案

Reason of this issue

why this happen ? this occurred because there different SHA1 in debug and release type.

I fix it by add the SHA1 of my used keystore(used to build release apk) to google console

here is all step to approach that

1- Get path of your keystore

when you generate signed APK

Build ----> Generate Signed APK..

keep in your mind the key store path

dont forget to make Build Type --- release

2- Extract SHA1 for used 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 Certificate fingerprints: you will find SHA1

3- generate android key using this SHA1 and your package name

generate APK using keystore and enjoy your map

这篇关于发布APK文件不显示谷歌地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆