0

I am trying to create a basic google map using google's android api v2. Whenever the map loads, it only shows gray squares. I followed all of the steps on this tutorial. My AndroidManifest.xml:

    <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tapdat"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <permission
        android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-feature
        android:glEsVersion="0x00020000"
        android:required="true" />

    <uses-permission android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.tapdat.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyBd4c2MqXtHS0DbC0QAxLZfvbX-5VJ3zU4" />

        <activity
            android:name="com.example.tapdat.PersonalMap"
            android:label="@string/title_activity_personal_map" >
        </activity>
        <activity
            android:name="com.example.tapdat.PersonalMapActivity"
            android:label="@string/title_activity_personal_map" >
        </activity>
    </application>

</manifest>

As you can see, I have internet permissions and a valid api key (I triple checked that it is valid and is for v2). I have tried running the app on an actual device and on an emulator with no success. My layout xml for the map:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:context=".PersonalMapActivity" >

    <fragment android:id="@+id/map"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              class="com.google.android.gms.maps.MapFragment" />

</RelativeLayout> 

LogCat reports System errors of

IOException: Server returned:3

This makes it sound like I am able to communicate with the server but it is denying my api request. Any suggestions? Do I have to run the application a special way?

Edit: This is what the google site shows under my api permissions (to show that it is for the correct package): https://i.stack.imgur.com/W8hU3.jpg

Linus Caldwell
  • 10,908
  • 12
  • 46
  • 58
Reed B
  • 636
  • 1
  • 8
  • 19
  • Have you even tried searching for the error message? – jlordo Jun 09 '13 at 17:45
  • Make sure that API key is correct for this package and for your signing key. – CommonsWare Jun 09 '13 at 17:46
  • @jlordo: it is to my understanding that there are two keys for v1 but only one for v2 (correct me if I'm wrong). – Reed B Jun 09 '13 at 17:52
  • @ReedB: read this site: [https://developers.google.com/maps/documentation/android/start#displaying_certificate_information](https://developers.google.com/maps/documentation/android/start#displaying_certificate_information) – jlordo Jun 09 '13 at 17:55
  • ah okay. I am currently using the debug keystore and followed all of the steps but it is displaying gray tiles. – Reed B Jun 09 '13 at 18:06
  • 2
    The declared permission `android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE` doesn't match up with your package name `android:name="com.example.tapdat.MainActivity"`. Make sure you thoroughly read through all the steps in the link given by @ReedB. – MH. Jun 09 '13 at 19:38

0 Answers0