3

I just deleted my Debug.keystore because an application displayed an error on the project file which I couldn't find. After deleting the keystone my app works fine except the fact that the map doesn't display at all - only the blank grey boxes that precede the loading of the map.

Does this mean I have to get a brand new Map API key because the application signature has changed?

P.S. The app worked fine before this therefore I have all required uses-library permissions etc.

Thanks

EDIT

After some snooping about I have answered my own question but when i tried to get a new API key it tells me that the Keystore File doesn't exist. I thought that when it gets deleted another one is rebuild/recreated automatically. What gives?

Katana24
  • 8,706
  • 19
  • 76
  • 118
  • Yes it does mean you need a new Google Maps API key – NickT Jan 26 '12 at 15:38
  • Aleks G forgive me if I forgot how the site works, also if you don't want to give at least a constructive reply then don't bother giving one at all. – Katana24 Jan 26 '12 at 15:50
  • Yes, please accept an answer--if you have answered your own question, then post it as an answer instead of a comment and accept that :) – Chad Schultz Jan 26 '12 at 15:57

2 Answers2

4

There is a debug keystore and a keystore for your signed app. The keystore file is in the hidden .android directory (on a Mac, inside the user directory).

Google Maps only works with a SIGNED APK. The debug keystore is not relevant then.

Create a signed APK. Make very, very sure to make backups of that keystore you create for this APK; you can't publish updates to the Android Market unless they're signed using the same keystore.

Generate your hash from that keystore file, get your API key, and use that in the app.

Even then, if you just run your app straight from Eclipse, you will not see the map, only the gray area... you must load the signed APK onto your phone, install from that, and then it should work. Hope this helps!

Chad Schultz
  • 7,770
  • 6
  • 57
  • 96
  • Do you mean that every application inherits a users particular signature - this signature is stored in the keystore for the app and is necessary for it to run on both devices and emulators. Whereas the debug keystore is just used for debugging purposes. The keystore is used to generate a Google maps API key when passed to java. – Katana24 Jan 26 '12 at 17:07
  • 1
    "Google Maps only works with a SIGNED APK. The debug keystore is not relevant then." <-- I think this is incorrect. See the following: http://code.google.com/android/add-ons/google-apis/mapkey.html#getdebugfingerprint You can obtain a Google Maps API Key for your debug certificate using this procedure, allowing map tiles to be loaded correctly in a debug build. – stephent Mar 27 '12 at 17:38
  • Good catch, Stephen. I wasn't aware of that. For me, it's less trouble to generate the API key once and then just package a signed APK, but it's good to know that separate debug API keys can be generated. – Chad Schultz Mar 27 '12 at 18:08
1

Does this mean I have to get a brand new Map API key because the application signature has changed?

Yes. You used an MD5 fingerprint of your original signing key to get the Map API key. You will need to follow the same steps to register a new MD5 fingerprint and get the corresponding Map API key.

After some snooping about I have answered my own question but when i tried to get a new API key it tells me that the Keystore File doesn't exist. I thought that when it gets deleted another one is rebuild/recreated automatically.

It will be on your next build. Make sure you are looking in the right place.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Where should i be looking then - in the hidden .android file under the user location? Or in the android.sdk, visible, in the user location? – Katana24 Jan 26 '12 at 17:03
  • @Katana24: "Where should i be looking then - in the hidden .android file under the user location?" -- that's certainly where I would expect to find it. If you are using Eclipse, the debug keystore location it uses can be found in Preferences | Android | Build. – CommonsWare Jan 26 '12 at 17:07
  • Cheers for the info CommonsWare. I found what I wanted and managed to generate a new Map API key :D – Katana24 Jan 26 '12 at 19:16