Drew LeSueur
Drew LeSueur

Reputation: 20185

Google Maps Android API v2 expiring dev API key

I have followed the instructions here (https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key) to create a dev api key and a release api key for Google Maps for Android V2.

I develop using the dev key. When I am ready to release, I switch to the release key (in AndroidManifest.xml), export my app, and upload it to the Google Play Store. When I go and develop again, I switch back to the dev key, but it no longer works. I have to generate a new on with the Google API console.

How can I get around needing to regenerate the dev key again and again?

Thank you.

Upvotes: 0

Views: 842

Answers (1)

Marcin Orlowski
Marcin Orlowski

Reputation: 75645

One maps key can easily work with multiple certificates, which allows you to have one Google Maps key, and do not bother which certificate your app is currently signed with.

To assign more certificates to one Google Maps key, simply put certificate hash and package name in separate line, i.e.:

AA:BB:CC.......;com.webnetmobile.test
XX:DD:ZZ.......;com.webnetmobile.test

where AA:BB:CC... is certificate hash. One entry is for your debug certificate another for production. You can also edit current key, to add new entries, so no need to recreate (unless you sure that's mandatory)

Upvotes: 2

Related Questions