3

In my app, I use maps to show the current position. Then, I use Google Maps Android API v2 (I don’t use Google Maps API) to add this functionality to my app.

When I am developing my app in eclipse everything is OK. I create an Android key with the debug keystore and I use it in the manifest, I can execute my app well and I can move and use the map. In this case I have no log errors (only the typical “The Google Play services resources were not found. Check your project configuration to ensure that the resources are included”).

Now when I upload my app to the Google Play Developer Console, in beta testing it works, but when I go publish, the map gets grey background and doesn’t work. Log gives me this error:

09-23 14:05:46.475: E/Google Maps Android API(5485): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
09-23 14:05:46.475: E/Google Maps Android API(5485): Ensure that the following correspond to what is in the API Console: Package Name: gc.yy.xxxx, API Key: AIza*******************************RDEI, Certificate Fingerprint: 472D********************************7218 (keystore use to sign the package)

Then I decide to use in my eclipse project that keystore, so I create a new Android key (47:2D:*************************:72:18;gc.yy.xxxx gives me AIza*****************Qm4Q key) and I paste it in the manifest file. I run the project and I get once again the grey background. Log gives me this error:

09-23 14:10:45.307: E/Google Maps Android API(5585): Authorization failure.  Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
09-23 14:10:45.317: E/Google Maps Android API(5585): Ensure that the following correspond to what is in the API Console: Package Name: gc.yy.xxxx, API Key: AIza*******************************Qm4Q, Certificate Fingerprint: CC4B********************************A917 (debug keystore)

I don’t know if the problems concerns to the keystore. I use debug.keystore with my map (I can’t use another one, I don’t know if it’s not possible) and I use a keystore I create to sign my app package. It seems an infinite loop of no useful API keys…

Thanks in advance!

EDIT: I finally solved it by adding the 2 meta-data blocks of each API key, that is to say, my manifest was like this:

    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIza*******************************RDEI" />
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="AIza*******************************Qm4Q" />

And finally, I have my app in Google Play! :)

David
  • 901
  • 1
  • 13
  • 37
  • did you generated the keystore your application instead of using debug.keystore – Sankar Ganesh PMP Sep 23 '13 at 13:36
  • have you tried fully uninstalling your app with one api key before installing the other one to avoid [issue of caching of old api key](http://stackoverflow.com/questions/17679317/android-google-maps-v2-authentication-error/17684309#17684309) – tony m Sep 23 '13 at 18:36
  • You need 2 different api keys: Debug key and Release key. Here is how to generate them: http://chocotech.blogspot.com/2012/10/get-debug-key-and-release-key-for.html – svlzx Dec 13 '13 at 12:01
  • 1
    Please write your solution up as an answer, not an edit to the question. – Flexo May 29 '15 at 05:41

2 Answers2

0

You need to register your non-debug keystore to the google maps API via the Google API console

Johnny Z
  • 14,329
  • 4
  • 28
  • 35
0

I used two different api keys (one for development, one for the release). At the end: that's stupid, since you can have several app hashes attached to one key. Hence that's the solution, just added on code.google.com/apis/console the release hash to the development api key (for backwards compatibility) and the development hash to the release api key (for easier development).

Lokesh
  • 5,180
  • 4
  • 27
  • 42