谷歌地图只显示空白的砖机器人 [英] Google map displaying only blank tiles android

查看:119
本文介绍了谷歌地图只显示空白的砖机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了谷歌地图在我app.But它仅显示为空白grids.I做改变AndroidManifest.xml文件,也包括在地图活动的布局文件API密钥。

I have implemented google map in my app.But its display only blank grids.I have done changes in AndroidManifest.xml file and also included API key in layout file of map activity.

推荐答案

这听起来可能很傻,但我一直遇到这个问题,直到我意识到<使用-许可> 标签必须是直接带孩子到<舱单> 元素,而非<应用> 元素。我曾错误地把他们的&LT之后,使用库> 标记。所以,你的Andr​​oidManifest.xml文件的最终结构应该是这样的:

This may sound silly, but I kept encountering this problem until I realized that the <uses-permission> tags need to be direct children to the <manifest> element, rather than the <application> element. I had erroneously been putting them right after the <uses-library> tag. So the final structure of your AndroidManifest.xml file should be something like this:

<?xml version="1.0" encoding="utf-8"?>
<manifest ... >
    <uses-sdk ... />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

    <application ... >
        <activity ... >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <uses-library android:name="com.google.android.maps" />

    </application>
</manifest>

希望这可以帮助任何人谁是犯同样的错误!

Hope this helps anyone who was making the same mistake!

这篇关于谷歌地图只显示空白的砖机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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