These are the steps I am following to generate my map key for android:
1-) I execute this command:
keytool -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android -keypass android
This command will have as an output something like this:
Alias name: androiddebugkey
Creation date: Mar 13, 2013
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 51401a0b
Valid from: Wed Mar 13 02:17:47 EDT 2013 until: Fri Mar 06 01:17:47 EST 2043
Certificate fingerprints:
MD5: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX
SHA1: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX
Signature algorithm name: SHA1withRSA
Version: 3
2-) After obtaining the SHA1, I copy it and then I open this link: https://code.google.com/apis/console/
I set on this feature:
3-) After that I generate a new key:
Where XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX
(is the SHA1 obtained above) and edu.osu.cse5326.busstopapp
is the single package of my project.
4-) Finally, I copy the map API Key generated:
5-) And I paste into one of my layouts:
<com.google.android.maps.MapView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapViewBusStopLocation"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="the_api_key"
/>
6-) I load the map from the corresponding Activity.
7-) This is my manifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.osu.cse5326.busstopapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<permission
android:name="edu.osu.cse5326.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="10" />
<application
android:name="edu.osu.cse5326.busstopapp.AppState"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name="edu.osu.cse5326.busstopapp.LoginActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Many other activities
</application>
</manifest>
THE PROBLEM is that I'm only seeing the grey area, without the map information.
This are the exception I'm getting when trying to run the project:
03-13 16:48:28.045: W/System.err(375): IOException processing: 26
03-13 16:48:28.045: W/System.err(375): java.io.IOException: Server returned: 3
03-13 16:48:28.045: W/System.err(375): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
03-13 16:48:28.045: W/System.err(375): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
03-13 16:48:28.045: W/System.err(375): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
03-13 16:48:28.055: W/System.err(375): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
03-13 16:48:28.055: W/System.err(375): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
03-13 16:48:28.055: W/System.err(375): at java.lang.Thread.run(Thread.java:1019)
03-13 16:48:28.365: W/System.err(375): IOException processing: 26
03-13 16:48:28.365: W/System.err(375): java.io.IOException: Server returned: 3
03-13 16:48:28.365: W/System.err(375): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
03-13 16:48:28.375: W/System.err(375): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
I have been reading a lot and I think this is a problem with the Map API Key, but I can't find what I am doing wrong.
Things I have tried and didn't work:
- Delete the debug.keystore and generate all over again.
- I have try to run on a real devide, instead of the emulator.
- Regenerate the map api key and wait a couple of hours to see if it takes time to work.