Android的工作室 - 谷歌地图上真正的Android设备仍是空白 [英] Android Studio - Google map still blank on real Android device
问题描述
通过了世界上所有的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! :(
- 启用谷歌地图V2 API
- 在创建与谷歌地图(在工作室默认的向导) 一个活动项目
- 在创建的谷歌键,调试项目,指定的 SHA1;应用程序在谷歌项目的关键 的应用程序包的
- 插入google_maps_api.xml(AndroidManifest.xml中更新automaticaly)API密钥
- 在建及放大器;运行在AVD ...应用程序正在运行,显示地图。
- enabled google maps v2 API
- created project with one activity with google map (default wizard in studio)
- created key on google for debug project, assigned SHA1;app package of application to the project key on google
- API key inserted into google_maps_api.xml (AndroidManifest.xml updated automaticaly)
- build & run on AVD ... app is working, map is shown.
然后:
- 在API已经启用
- 在Android的创建工作室密钥库发布(keystore.rel.jks)
- 在生成的指纹(密钥工具-list -v -keystore C:\ Dropbox的\ AndroidKeyStore \ keystore.rel.jks)
- 在谷歌增加了新的指纹到新版本的项目(发布SHA1;应用程序包的) - 密钥生成AIza ...
- 插入google_maps_api.xml(AndroidManifest.xml中更新automaticaly)API密钥
- 生成签名的应用程序(使用keystore.rel.jks)及安装在实际设备...程序工作时,地图仍是空白,只有变焦按钮和谷歌标签是
- API already enabled
- in Android studio created keystore for release (keystore.rel.jks)
- generated fingerprints (keytool -list -v -keystore C:\Dropbox\AndroidKeyStore\keystore.rel.jks)
- on google added new fingerprint to the new release project (release SHA1;app package) - key generated AIza...
- API key inserted into google_maps_api.xml (AndroidManifest.xml updated automaticaly)
- 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的工作室 - 谷歌地图上真正的Android设备仍是空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!