Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Obtaining Google Maps API key

I'm using Windows 7.

I have tried several times with the debug.keystore with appears in c:\users\YOURUSER.android\ using the command:

keytool -list -alias androiddebugkey -keystore c:\Users\YOURUSER\.android\debug.keystore -storepass android -keypass android

It gives me a MD5, but then I go to Google MD5 registration page and it sais it is not a valid fingerprint.

I searched for more information, and I finally created a new debug.keystore into c:\users\YOURUSER\ to avoid rewriting the original one. I used this command:

keytool -genkey -keypass android -keystore c:\users\YOURUSER\debug.keystore -alias androiddebugkey -storepass android -validity 10000 -dname "CN=Android Debug,O=Android,C=US"

It works, so I use the previous command to get the MD5, and it gives me a new MD5. Then I go to Google again and the same problem: "not a valid fingerprint".

The I made a second attempt. This is what I did then: 1) Opened a Windows7 terminal, went to c:\program files\java\jdk1.7.0\bin\ 2) Wrote command:

 keytool -genkey -v -keystore c:\eclipse\my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

3) Then I tried to get the MD5 code from my keystore, using comand:

keytool -list -alias alias_name -keystore c:\eclipse\my-release-key.keystore

and writing the password I am asked. It gives me a MD5.

4) I go to maps api key sign up and write the MD5. "FINGERPRINT NOT VALID"

I don't know what the problem is. And I am supposed to do this for every app I program? What a headache!

Can anybody help me please?

like image 519
Roman Rdgz Avatar asked Sep 29 '11 21:09

Roman Rdgz


People also ask

Is API key for Google Maps free?

You won't be charged until your usage exceeds $200 in a month. Note that the Maps Embed API, Maps SDK for Android, and Maps SDK for iOS currently have no usage limits and are at no charge (usage of the API or SDKs is not applied against your $200 monthly credit).

Can you expose Google Maps API key?

If you're building a GCP application, see using API keys for GCP. When you use API keys in your Google Cloud Platform (GCP) applications, take care to keep them secure. Publicly exposing your credentials can result in your account being compromised, which could lead to unexpected charges on your account.

How do I find my API key?

The new API key is listed on the Credentials page under API keys. (Remember to restrict the API key before using it in production.)


2 Answers

Are you sure you get the MD5 and not the SHA1 fingerprint? Tryed the -v option? see: How can I get the MD5 fingerprint from Java's keytool, not only SHA-1?

like image 103
Warpzit Avatar answered Oct 06 '22 00:10

Warpzit


google maps has deprecated its previous version API v1 and introduced a new version of google maps API v2.

previously we generated md5 key but now we need to generate sha-1 fingerprint certificate.

The Maps API key is based on a short form of your application's digital certificate, known as its SHA-1 fingerprint. The fingerprint is a unique text string generated from the commonly-used SHA-1 hashing algorithm. Because the fingerprint is itself unique, Google Maps uses it as a way to identify your application.

please go through the links it could help you

https://developers.google.com/maps/documentation/android/start#the_google_maps_api_key

https://developers.google.com/maps/documentation/android/intro#sample_code

also see the same kind of post in stack over flow

How to implement Google Maps new version of API v2

like image 27
bapatla Avatar answered Oct 06 '22 00:10

bapatla