Google仅将灰色背景映射为APK [英] Google maps only a grey background as APK

查看:83
本文介绍了Google仅将灰色背景映射为APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用android-studio和通过USB连接的Galaxy S3 android手机进行本地开发.

I develop locally with android-studio and a Galaxy S3 android phone connected via USB.

在我的本地开发环境中,当我启动要在S3上部署的运行配置时,一切正常-地图显示正常.

On my local development environment, when I fire up the run configuration to deploy on the S3, everything works fine - the map shows up just fine.

但是,当我将签名的APK部署到我们的服务器上并通过Internet安装时(我正在尝试在另一台Android手机上保持清晰分开),地图图块无法加载,我在左下角看到了Google标志以及右上角的GPS位置图标.

But when I deploy as signed APK to our server, and install via Internet (I am trying on another android phone to keep things clearly separated), the map tiles don't load, I see the Google sign to the lower left and the GPS location icon on the upper right corner.

我看过一些相关的帖子:

I've seen a few related posts:

> Google Google Maps应用程序显示灰色背景而不是地图

这似乎有点过时,其次他使用了eclipse(我正在使用android-studio),第三次-它对我不起作用.

which seems first a bit dated, second he uses eclipse (I am using android-studio), third - it didn't work for me.

Android-Google Maps Gray Screen on Signed APK 这个人没有得到关于他的问题的任何有用答案....

Android - Google Maps Grey Screen on Signed APK This guy didn't get any useful answers to his question....

推荐答案

第一步是使用keytool命令行工具获取用于签名应用发布版本的密钥的SHA1值./p>

The first step is to get the SHA1 value for the key that you used to sign the release version of your app using the keytool command line tool.

keytool -list -v -keystore ~/Keystore/key1.jks -storepass <your_store_password> -keypass <your_key_password> 

用用来签名发行版本的密钥库的路径和名称替换~/Keystore/key1.jks,并用您自己的密码替换密码.

Replace ~/Keystore/key1.jks with the path and name of the keystore that you used to sign your release version, and replace the passwords with your own.

在命令行上执行此命令时,它将列出证书指纹,包括所需的SHA1值.

When you execute this command at the command line, it will list the Certificate Fingerprints, including the SHA1 value that you need.

下一步是将SHA1和程序包名称添加到 Google Developers Console的键中 a>.

The next step is to add the SHA1 and package name to a key in the Google Developers Console.

您可以将其添加到调试版本所用的相同密钥中,也可以创建一个新密钥.

You can either add it to the same key you used for debug builds, or you can create a new key.

要将发布SHA1和程序包名称添加到现有的API密钥,请单击Add package name and fingerprint按钮,然后添加您的SHA1值和程序包名称.

To add your release SHA1 and package name to an existing API key, click the Add package name and fingerprint button, and add your SHA1 value and package name.

然后,您可以将此API密钥与应用程序的签名发行版一起使用.

Then, you can use this API key with the signed release version of your app.

有关在使用其他API密钥进行调试和发布时如何配置应用的更多信息,请参见

For more information on how to configure your app if you use a different API key for debug and release, see here.

这篇关于Google仅将灰色背景映射为APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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