0

I am trying to make my MapView run on android. But I get an empty grid.

I followed the exceptions and I get an error: "java.io.IOException: Server returned: 3".

I deleted my debug.keystore several times, recreated it. I created new api keys with the api console each time.

This is how I declared my MapView:

<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapView"
    android:layout_width="match_parent"
    android:layout_height="184dp"
    android:layout_x="0dp"
    android:layout_y="0dp"
    android:apiKey="my api key"
    android:clickable="true" >
</com.google.android.maps.MapView>

I also added several permissions in my android manifest file:

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

<permission android:name="com.example.conti_lab6.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="com.example.conti_lab6.permission.ACCESS_COARSE_LOCATION"></uses-permission>
<uses-permission android:name="com.example.conti_lab6.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="com.example.conti_lab6.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<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"/>
<!-- The following two permissions are not required to use
     Google Maps Android API v2, but are recommended. -->
<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">

    <activity
        android:name="com.example.conti_lab6.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>
    <uses-library android:name="com.google.android.maps" /> 
</application>

I am out of ideas for this. I am running the emulator locally and it should use the debug.keystore in my .android file.

Alecu
  • 2,627
  • 3
  • 28
  • 51
  • refer this, http://stackoverflow.com/questions/7296467/google-map-signed-api-key-errors-in-android http://stackoverflow.com/questions/12448034/android-google-map-errors-basetilerequest-server-returned-3 – rajeshwaran Mar 26 '13 at 13:10
  • Are you using googlemap api v2 – Janmejoy Mar 26 '13 at 13:22
  • yes, I am using api v2. But just in case how can I check? I downloaded the lastest Google APIs and I am using the emulator for platform v17. – Alecu Mar 26 '13 at 13:27

1 Answers1

1

So in case of Api V2

you need some little changes

Layout:

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:map="http://schemas.android.com/apk/res-auto"
  android:id="@+id/map"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
 class="com.google.android.gms.maps.SupportMapFragment"/>

And you have to add the google play library ,And The error which you are getting is generally occured when you are running your app Using v1 api key

And for the key generating you can use SHA1 certificate with package name.

For more information check this link

Janmejoy
  • 2,721
  • 1
  • 20
  • 38