deveLost
deveLost

Reputation: 1171

Android : errors to load google map

I'm trying to load a map with Google API V2, but i meet few errors that i don't understand..

I've these errors :

Could not find class 'gpr', referenced from method gps.a
Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence',      referenced from method glt.a
Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

Here, it's my manifest (a part) :

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

       <uses-permission android:name="android.permission.ACCESS_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_GPS" />
<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" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission  android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="@string/keyAndroid"/>

    <meta-data 
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

I forgot something ? I checked the SHA1 of my certificate, and there is no error with that.

Thx,

Upvotes: 0

Views: 99

Answers (1)

mapodev
mapodev

Reputation: 988

There is a difference between Debug and Release keys. You need to generate the specific SHA1 key for the developer console and for your specific use of the app.


DEBUG

When you want to see the map in debug, you will find the debug key here (eclipse)

enter image description here

Or in the folder

~/.android/debug.keystore

In Windows it is

C:\User\YourUser.android\debug.keystore

You need to generate the SHA1 key of that keystore and add it in the Developer Console in your Google Maps API v2 for Android


RELEASE

For release keys you will have to go trough these four steps:

You need to (taken from here Generating Google map Release API Key):

  1. Create your own signing key that you will use for publishing, using Keytool : http://developer.android.com/guide/publishing/app-signing.html#cert

  2. Get the MD5 fingerprint of your newly generated key : https://developers.google.com/maps/documentation/android/mapkey#getfingerprint

  3. Submit the signature to this link to get your Google Maps key : https://developers.google.com/android/maps-api-signup?hl=fr

  4. Export your application with your newly created key, in Eclipse : right click on your projet -> Android Tools -> Export signed application package.

Important thing to notice here, that you need to add the package name at the end of the SHA1 key. Like

AB:CD:EF...:08;com.yourpackage.yourapp


USING THE KEYS

Then when you got those two keys, you will have to update it always when you are either using debug or release. Don't mix them up, write a comment next to the key entry like

<!-- DEBUG KEY: 12345... -->
<!-- RELEASE KEY: 23456... ->

Upvotes: 1

Related Questions