Android的工作室 - 谷歌地图上真正的Andr​​oid设备仍是空白 [英] Android Studio - Google map still blank on real Android device

查看:193
本文介绍了Android的工作室 - 谷歌地图上真正的Andr​​oid设备仍是空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过了世界上所有的Google搜索,阅读数以百万计有关如何生成谷歌API密钥意见的,如何使用它......没有什么作品!排气! :(

googled through over all the world, read millions of advices about how to generate google API key, how to use it... nothing works! Exhausting! :(

  1. 启用谷歌地图V2 API
  2. 在创建与谷歌地图(在工作室默认的向导)
  3. 一个活动项目
  4. 在创建的谷歌键,调试项目,指定的 SHA1;应用程序在谷歌项目的关键
  5. 的应用程序包
  6. 插入google_maps_api.xml(AndroidManifest.xml中更新automaticaly)API密钥
  7. 在建及放大器;运行在AVD ...应用程序正在运行,显示地图。
  1. enabled google maps v2 API
  2. created project with one activity with google map (default wizard in studio)
  3. created key on google for debug project, assigned SHA1;app package of application to the project key on google
  4. API key inserted into google_maps_api.xml (AndroidManifest.xml updated automaticaly)
  5. build & run on AVD ... app is working, map is shown.

然后:

  1. 在API已经启用
  2. 在Android的创建工作室密钥库发布(keystore.rel.jks)
  3. 在生成的指纹(密钥工具-list -v -keystore C:\ Dropbox的\ AndroidKeyStore \ keystore.rel.jks)
  4. 在谷歌增加了新的指纹到新版本的项目(发布SHA1;应用程序包的) - 密钥生成AIza ...
  5. 插入google_maps_api.xml(AndroidManifest.xml中更新automaticaly)API密钥
  6. 生成签名的应用程序(使用keystore.rel.jks)及安装在实际设备...程序工作时,地图仍是空白,只有变焦按钮和谷歌标签是
  1. API already enabled
  2. in Android studio created keystore for release (keystore.rel.jks)
  3. generated fingerprints (keytool -list -v -keystore C:\Dropbox\AndroidKeyStore\keystore.rel.jks)
  4. on google added new fingerprint to the new release project (release SHA1;app package) - key generated AIza...
  5. API key inserted into google_maps_api.xml (AndroidManifest.xml updated automaticaly)
  6. generate signed app (using keystore.rel.jks) & install on real device ... app is working, map is STILL BLANK, only zoom buttons and Google label is on

在此先感谢您的任何建议。

Thanks in advance for any advice.

兹德涅克

推荐答案

请确保您的下释放文件夹google_maps_api.xml输入您发布的API密钥。

Make sure you enter your release API key in the google_maps_api.xml under the release folder.

首先,切换使用下拉项目浏览器的左上角,以项目视图。然后,展开应用程序/ src目录/ ,你会看到子文件夹调试发布。在那里,你应该可以看到两个独立的google_maps_api.xml文件调试/ RES /值发布/ RES /值

First, switch to Project view by using the dropdown in the upper left of the Project Explorer. Then, expand app/src/, and you will see subfolders debug and release. Under there, you should see two separate google_maps_api.xml files under debug/res/values and release/res/values.

请确保发布API密钥是在发布/ RES /值文件夹下的文件google_maps_api.xml,因为这是将要使用的一个签署发布APK。

Make sure that the release API key is in the google_maps_api.xml file under the release/res/values folder, since this is the one that will be used for the signed release apk.

这篇关于Android的工作室 - 谷歌地图上真正的Andr​​oid设备仍是空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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