我发现了这个不同的话题,但都没有让我看到在我的活动中工作的地图。 我遵循了google提供的有关使用Google Play服务中的地图的指南:
<?xml version =1.0encoding =utf-8?>< manifest xmlns:android =schemas.android/apk/res/androidpackage =net.labinfo.hotels.core> < uses-permission android:name =android.permission.INTERNET/> < uses-permission android:name =android.permission.ACCESS_NETWORK_STATE/> < uses-permission android:name =android.permission.ACCESS_WIFI_STATE/> < uses-permission android:name =android.permission.VIBRATE/> < uses-permission android:name =android.permission.ACCESS_FINE_LOCATION/> < uses-permission android:name =android.permission.ACCESS_COARSE_LOCATION/> < uses-permission android:name =android.permission.WRITE_EXTERNAL_STORAGE/> < uses-permission android:name =com.google.android.c2dm.permission.RECEIVE/> < uses-permission android:name =net.labinfo.hotels.core.permission.MAPS_RECEIVE/> <! - GCM需要一个Google帐户。 - > < uses-permission android:name =android.permission.GET_ACCOUNTS/> < uses-permission android:name =net.labinfo.hotels.core.permission.C2D_MESSAGE/> <! - 收到消息时使处理器保持休眠状态。 - > < uses-permission android:name =android.permission.WAKE_LOCK/> < uses-permission android:name =com.google.android.providers.gsf.permission.READ_GSERVICES/> < application android:allowBackup =trueandroid:largeHeap =trueandroid:theme =@ style / AppTheme> < meta-data android:name =com.google.android.gms.analytics.globalConfigResourceandroid:resource =@ xml / global_tracker/> .....< / activity> < activity android:name =。components.activities.avis.AvisMappaActivityandroid:label =@ string / title_activity_avis_mappa> < /活性GT; < uses-library android:name =com.google.android.maps/> < meta-data android:name =com.google.android.maps.v2.API_KEYandroid:value =@ string / google_maps_key/> < / application>< / manifest>
是只显示角落里的谷歌徽标的活动,没有logcat错误或通知的迹象。 我错过了什么吗?我看到在api键的谷歌控制台生成过程中,它向我展示了一个SHA键,但我从来没有使用它。
希望有人能帮助我这
解决方案我解决了它。正如你们所有人都建议这是API密钥,特别是与该密钥相关的许可。
我的问题是软件包名称,因为我使用了一个具有不同模块的应用程序,发送到服务器的包名称与用于自动创建密钥的包名称不同。所以我解决了这个问题,增加了使用相同SHA1键的另一个软件包名称的权限。
对于所有未来的读者,我希望您注意到我拥有没有错误显示,直到我从SupportMapFragment切换到MapFragment,所以我建议这样做进行调试。
感谢任何人的帮助,欢呼。
I've found different topic about this, but neither got me the maps working in my activity. I've followed the guide provided by google about using maps from google play service:
Still the result is the activity showing only the google logo in the corner and no sign of errors or notifications from logcat. Am I missing something? I saw that during the google console generation of the api key it showed to me a SHA key, but I've never used it.
Hope somebody can help me out about this
解决方案I've solved it. As all of you suggested it was the API key, in particular permissions related to that key.
My problem was the package name, since I used an app with different module, the package name sent to the server was different than the one used to create the key automatically. So I've fixed the problem adding to permission another package name with the same SHA1 key.
For all future readers, I want you to note that I had no error shown until I switched from SupportMapFragment to MapFragment, so I suggest to do so for debugging.
Thanks to anyone helping, cheers.
更多推荐
Google地图不显示/空白
发布评论