0

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,

8
  • meta-data should be inside application tag in manifest Commented Jul 26, 2014 at 14:56
  • yes, it's the case :) Commented Jul 26, 2014 at 14:56
  • 1
    notice that debug and release app keys are different. Commented Jul 26, 2014 at 14:57
  • Issue is about your API Key. Generate a new key and try again.. Commented Jul 26, 2014 at 14:59
  • i tried it, and not resolve the problem :/ Commented Jul 26, 2014 at 15:00

1 Answer 1

1

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... ->
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.