Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google map displaying only blank tiles android

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.

like image 928
Anamika Avatar asked Apr 23 '11 11:04

Anamika


2 Answers

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!

like image 80
Alan Keegan Avatar answered Sep 27 '22 21:09

Alan Keegan


I was having the same problems until I realised that in the API console I had enabled

Google Maps API v2

and not the

Google Maps Android API v2

Once I enabled it everything was fine.

like image 21
Tim Avatar answered Sep 27 '22 21:09

Tim