简体   繁体   English

Android-Google Maps API不显示地图

[英]Android - Google maps API not showing maps

I am using google maps API with my android app and its not showing anything but blank maps. 我在我的Android应用程序中使用了Google Maps API,除了空白地图外,它没有显示任何内容。

Here is the screen shot. 是屏幕截图。

I have obtained an API key from google developers and pasted into google_maps_api.xml both in debug and release version. 我已经从Google开发人员那里获得了API密钥,并以调试和发行版本的形式粘贴到google_maps_api.xml中。

<string name="google_maps_key" translatable="false" templateMergeStrategy="preserve">
        AIzaSyCAiL844hgfM2S_kDApCrITIzj-S5wgBzA
</string>

I registered my app on google developers account also Screenshot 我也在Google开发人员帐户上注册了我的应用程序屏幕截图

I did not do anything with the maps but just selected the MapsActivity from wizard. 我对地图没有做任何事情,只是从向导中选择了MapsActivity。

Permissions: 权限:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

There are a few reasons why your Google Map is not showing nothing. 有几个原因导致您的Google Map不显示任何内容。

Youu have to put something like this A5:1A:89:84:A9:5C:B7:13:6D:7C:28:20:C5:65:A4:F4:97:E4:98:99;co.mipackage.example. 您必须输入这样的内容A5:1A:89:84:A9:5C:B7:13:6D:7C:28:20:C5:65:A4:F4:97:E4:98:99; co.mipackage 。例。 The number, in my case A5:1A:89:84:A9:5C:B7:13:6D:7C:28:20:C5:65:A4:F4:97:E4:98:99 have to be the assigned number for your computer, so you have to see if it is correct. 在我的情况下,必须分配数字A5:1A:89:84:A9:5C:B7:13:6D:7C:28:20:C5:65:A4:F4:97:E4:98:99您的计算机的编号,因此您必须查看它是否正确。 The path of the package have to be correct too. 包装的路径也必须正确。

Well thank you everyone for suggestions but I have solved my issue. 好,谢谢大家的建议,但我已经解决了我的问题。

Problem was with my Package name it was com.example.picturetrackerapp in my project but was registered as com.example.picturetracker on google developers account. 问题是我的软件包名称在我的项目中为com.example.picturetrackerapp,但已在Google开发人员帐户中注册为com.example.picturetracker。 I changed it and my problem solved 我改变了我的问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM