You are on page 1of 11

How to get Google Maps API Key for Android. Issues and Errors Solved.

| Mir Pgina 1 de 11

Mir

Mir Nauman Tahir. Development, Configurations, Tutorials and bla bla


bla ....

How to get Google Maps API Key for Android. Issues


and Errors Solved.
January 26, 2012 in Android General, Android Google Maps API Ver 1.0 | Tags: debug.keytool, Google Maps API Key, jdk1.7 keytool,
Keytool, MD5 generation using keytool, SHA1 generation using keytool, Sign up for Android Maps API

12 Votes
To use Google Maps in Android using MapView Control we need Google Maps API Key. To get the key we
have to go through the following steps.

1. Locate debug.keystore file on your system.


2. Locate keytool.exe file on your system
3. Generate MD5 fingerprint.
4. Use that MD5 fingerprint to get the Google Maps API Key

The debug.keystore file can be found at c:\users\mir nauman tahir\.android\debug.keystore

Replace mir nauman tahir with your current user name.

Path to debug.keystore

Now navigate to keytool.exe file. c:\program files\java\jdk1.7.0_02\bin\keytool.exe

Replace the jdk version with the version installed on your system.

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 2 de 11

Path to keytool.exe

Now execute the following command.

C:\Program Files\Java\jdk1.7.0_02\bin>keytool.exe -list -alias androiddebugkey -keystore c:\users\mir


nauman tahir\.android\debug.keystore -storepass android -keypass android

If prompted for a password, try changeit or just press enter key to enter an empty password. This command
will return SHA1 fingerprint. jdk1.7 or higher will return SHA1 by default. Remember the bold and italic text is
the path to the debug.keystore file. You have to provide the path to debug.keystore file on your system.
Secondly the path to the debug.keystore file must be enclosed in double quotes.

jdk1.7 Keytool returning SHA1 fingerprint.

We dont need SHA1. we need MD5 fingerprint so either we have to use jdk1.6 or we can use the following
command to generate MD5 finger print using jdk.17.

C:\Program Files\Java\jdk1.7.0_02\bin>keytool.exe -v -list -alias androiddebugkey -keystore c:\users\mir


nauman tahir\.android\debug.keystore -storepass android -keypass android

By putting a -v in the command it will generate the following output.

jdk1.7 keytool generating MD5 fingerprint

Copy the MD5 fingerprint. LogIn to your google account (even signing in to gmail will work). Than navigate to
the following url http://code.google.com/android/maps-api-signup.html . Paste your MD5 fingerprint in field
shown in the picture below and click generate api key.

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 3 de 11

Using our MD5 fingerprint to generate the Google Maps API Key

When you click generate button you will be taken to another screen showing your MD5 fingerprint, your
Google Maps API Key and how you can use it in your code to enable Google Maps in Android development.

Google API Key generated by using our MD5 fingerprint

Mission Accomplished.

Note:- Please leave your comments if this article was helpful.

If you cant find debug.keystore file in .android folder than follow the link to solve that issue.

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 4 de 11

http://mirnauman.wordpress.com/2012/04/04/cant-find-debug-keystore-in-android-folder-issue-solved/
About these ads

Share this:

Like this: Loading...

59 comments
Comments feed for this article

January 30, 2012 at 11:54 am [...] http://mirnauman.wordpress.com/2012/01/26/how-to-


Using Google Maps in Android get-google-maps-api-key-for-android-issues-and-erro
Development Tutorial Part 1. Mir [...]
Reply

February 3, 2012 at 2:50 pm thank you vary much


Max
Reply

February 13, 2012 at 6:18 am [...] http://mirnauman.wordpress.com/2012/01/26/how-to-


Adding image to GoogleMaps using get-google-maps-api-key-for-android-issues-and-erro
map overlays. Android tutorial Part [...]
3 Mir Reply

February 22, 2012 at 8:12 am Great work hey? It was a very easy to
Chirs work through. Looking forward to
building an android app.

Reply

April 4, 2012 at 10:49 am [...] http://mirnauman.wordpress.com/2012/01/26/how-to-


Cant find debug.keystore get-google-maps-api-key-for-android-issues-and-erro
in .android folder. Issue Solved. [...]
Mir Reply

April 21, 2012 at 7:00 am In very gread document for getting


ks MD5..thank u so much.

Reply

May 9, 2012 at 3:54 am Reblogged this on Mir.


Mir
Reply

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 5 de 11

May 26, 2012 at 8:12 am thank you so much you saved plenty of
jyo time of mine..very good explanation

Reply

June 21, 2012 at 2:27 pm Thank you Mir i have done the
ahsan code of map its working an mobile but
not running in Emultor.. what will be the
problem please tell me.
I will w8 4 your rly

Reply

June 22, 2012 at 4:11 am Dear ahsan,


Mir
plz check ur sdk version and google api
version. provided that ur google maps api key is correct.

Reply

July 1, 2012 at 9:48 pm Thanks a bunch.. you made it really


Syed easy.

Reply

July 7, 2012 at 7:30 pm Cara, tu um genio, estou a horas com


Romulo esse maldito problema com o md5.
Muito obrigado.

Grande abrao.

Reply

July 9, 2012 at 12:25 pm Dear romulo, i dont understand what u


Mir have commented. can u post your
comments in English please.

Reply

July 26, 2012 at 10:27 am dear mir my cmd gives an error keytool
bilal error: java.lang.exception:keystore file
doesnot exist

Reply

July 27, 2012 at 3:40 am dear bilal,


Mir kindly go through the following article
http://mirnauman.wordpress.com/2012/04/04/cant-find-debug-keystore-in-
android-folder-issue-solved/
hope it will solve the problem.

Reply

July 26, 2012 at 11:17 am man i found the solution i wasnt in the
bilal administrator mode thanx anyways

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 6 de 11

Reply

August 24, 2012 at 11:43 am Worked as charm! thanks bro!


Me
Reply

August 27, 2012 at 6:26 am you are welcome.


Mir
Reply

September 1, 2012 at 1:53 pm Thank you so much. Went through >100


Helen posts everywhere -> map not showing in
Google Maps example, Factory client error in
Java, etc., turned out that I used a wrong debug.keystore.

Ps. Romulo says something like: what an annoying problem with md5. Thank
you very much. Big hug

Reply

September 1, 2012 at 3:17 pm Helped to solve my problem of not


Sergei being able to display Google map tiles.
Before reading the article was using SHA1 to
generate the key.

Reply

September 8, 2012 at 5:16 am Great workbuddy


Krushnakant
Reply

September 19, 2012 at 11:10 am Thanx it was very helpfull ))


uth
Reply

October 8, 2012 at 9:45 pm Really helpful ..so simple tutorial.


salamswati
thanks Nauman bhai

Reply

November 17, 2012 at 3:25 am Thank you for the very informative
Alican zgren article, it was very helpful.

Reply

November 27, 2012 at 1:01 pm hey buddy it is really simple effective


Durratulmazd Rokadia and helpful good work.thanx
keep going

Reply

December 1, 2012 at 5:15 pm Thanks a lot, it worked fine. Easy and


LuisManuel simple tutorial. My problem was
thinking that Google Maps API Key for web
browser would also work for Android.

Reply

December 2, 2012 at 5:51 am

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 7 de 11

Vishal im facing this problem


The fingerprint that you entered is not valid.

plz help me

Reply

December 3, 2012 at 6:21 pm u must be using SHA1 instead of MD5.


Mir check the tutorial again

Reply

December 4, 2012 at 12:08 pm C:\Program Files\Java\jdk1.6.0_19


Vishal \bin>keytool.exe -list -ali
as androiddebugkey -keystore
C:\Users\Vishal\.android\debug.
keystore -storepass android -keypass android
androiddebugkey, Dec 3, 2012, PrivateKeyEntry,
Certificate fingerprint (MD5): 75:1E:9E:28:**:**:**:**:**:**
:**:**:**:**:**:**

C:\Program Files\Java\jdk1.6.0_19\bin>

This is my MD5 key still im facing the same problem. plz hel me sir

Reply

January 28, 2013 at 1:22 pm Thx! you r GOD! i wasted a lot of time
dyk before a read this!

Reply

January 28, 2013 at 1:45 pm thanks for the compliment, but am not a
Mir GOD. i documented this coz i wasted a
week on figuring this out. am glad its helping
other too. thanks for liking my post.

Reply

February 6, 2013 at 7:13 am hey Mirthere is some problem.. when


Abdul i am clicking on this
http://code.google.com/android/maps-api-
signup.html
it automatically transfers it to
https://developers.google.com/maps/documentation/android/
and i m not able to get map key.. Plz help

Reply

February 20, 2013 at 11:52 am Dear Abdul,


Mir i have checked wat u said. google has
launched Google Maps API V2. i ll check how
to coupe up with this. am a bit occupied these days but i will start working
from scratch on API V2

Reply

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 8 de 11

May 6, 2013 at 11:45 am when i clicking this link


Raghuram http://code.google.com/android/maps-
api-signup.html
it automatically transfers it to
https://developers.google.com/maps/documentation/android/
and i m not able to get map key.

please send the api genetation link to my mail id plz.


(g.rahuram@gmail.com)

June 10, 2013 at 5:40 pm here is the new page for getting google
mohamed dahab map api version 2 :
you just go to service , and all the the taps
near to it
code.google.com/apis/console

May 6, 2013 at 11:43 am hello abdul


Raghuram Do u find the solution of this problem
please send me that link to my mail id
(g.rahuram@gmail.com).

when i clicking this link http://code.google.com/android/maps-api-


signup.html
it automatically transfers it to
https://developers.google.com/maps/documentation/android/
and i m not able to get map key..

Reply

February 21, 2013 at 2:01 pm With the new API v2 you need SHA1
greendog fingerprint, MD5 is not longer possible.
And for generating SHA1 fingerprint is Java
1.7 needed.

Reply

February 21, 2013 at 8:01 pm Good day very cool blog!! Man ..
shopperpress Excellent .. Superb .
. I will bookmark your site and take the
feeds additionally? Im happy to search out so many useful information right
here within the post, we need work out extra strategies in this regard, thank
you for sharing. . . . . .

Reply

February 22, 2013 at 3:05 pm Ive been done all the following steps
Apriandana D.Pribadi but unfortunately the result is
(@iluz7) keytool error: java.lang.RuntimeException:
Usage error, and is not a legal command ,
whats wrong with it ? I use java 1.6 , thanks

Reply

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 9 de 11

February 26, 2013 at 8:12 am use java 1.7 as i have written the
Mir tutorials with 1.7. follow the following
tutorial
http://mirnauman.wordpress.com/2012/04/04/cant-find-debug-keystore-in-
android-folder-issue-solved/
it might solve ur issue with keytool

Reply

March 15, 2013 at 4:57 am Hi it is very helpfull to generate md5 api


Durgarao key
Good
Thanks sir

Reply

March 21, 2013 at 8:22 am Thanks for your helpful steps.


Mahesha
Reply

March 24, 2013 at 7:53 pm Thanks..


Maimoonah Its good to add search box for this
website

Reply

April 15, 2013 at 2:52 pm now plz send latest procedure becuase
sultan this websites change when i click ur
given link it go somwhere else
plz anybody help

Reply

April 26, 2013 at 5:41 am hey Mir I have generate the API key but
lalitkumar it is not Showing map when i published
the app in google play

Reply

May 6, 2013 at 10:36 am the aps developed with google maps api
Mir ver 1.0 will not work with google maps
api ver 2.0.
Google Play has ver 2.0. you need to develop ur app for 2.0.

Reply

June 11, 2013 at 5:06 pm Dear lalit,


Mir Follow my latest series of articles. That
will solve ur issues.

Reply

May 6, 2013 at 9:32 am thanks for your helpful guide however i


Andrew get error message which states The file
name, directory or volume label syntax is
incorrect. when i type C:\Program Files\Java\jre7\bin\keytool.exe -v -list -

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 10 de 11

alias androiddebugkey -keystore C:\Users\Atwine\.android\debug.keystore


-storepass android -keypass android

Reply

May 6, 2013 at 10:34 am update your JRE. than check the bin
Mir folder manually. does it have the
keytool.exe file. than check the android folder
in ur urser folder to see if there is any debug.keystore. if everything is in
place than run the command again. it will work. if not check ur command
specially the paths. there must be something wrong there.

Reply

May 10, 2013 at 7:57 am Sir I am using ur this tutorial to use


Rajeev Ranjan google map in my app, but when I use
MD5 fingerprint then google api console say
Invalid Input, but when I use SHA1, it generates apikey, and I am using this
generated api key in my app,But only grid is displaying without map.Error is
coming like- Couldnt get connection factory client.
Plz help me Sir..

Reply

May 14, 2013 at 11:06 am this could be a problem of a wrong api


Mir key. or the permissions. are u using
google maps api 1 or 2.

Reply

May 27, 2013 at 11:35 am hi sir ,, same problem , please reply


mohamed dahab

June 10, 2013 at 5:41 pm here is the site chose service :


mohamed dahab code.google.com/apis/console

Reply

June 18, 2013 at 11:13 am [] the SHA-1 fingerprint through command prompt.
Our First Android Google Maps The command is explained in detail in the link How to
API Ver 2.0 Application. Getting get Google Maps API Key but there is a simple way to
the Android Google Maps Api Ver find out SHA-1 fingerprint but before we get this
2.0 Key. Part # 2 | Mir fingerprint we need []
Reply

July 4, 2013 at 10:45 am please give me full code of Google


mayank MAP API V2
here, i have created one application n i used
Google Map API V1
so, now i want to update Google Map Api v2
so please help us. we need full source code in Google Map Api v2
please help us : mayank.langalia@live.com

Reply

July 9, 2013 at 7:51 am


Mir

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013
How to get Google Maps API Key for Android. Issues and Errors Solved. | Mir Pgina 11 de 11

http://mirnauman.wordpress.com/2013/06/18/our-first-android-google-maps-
api-ver-2-0-application-getting-the-android-google-maps-api-ver-2-0-key-
part-2/?preview=true&preview_id=608&preview_nonce=1b2df11a26

Check the link at the bottom of the article, download link for the source code
is available.

Reply

July 8, 2013 at 11:00 pm [] The problem is that the map doesnt load in it just
Goolgle maps isnt loading a map in shows a grid of grey rectangles. I cant see any errors
my app - Tech Forum Network myself but I dont where to look. I have generated the API
key for google maps for my certificate and by debug keystore as countless tutorials and topics on
here suggest. Link 1 []
Reply

July 9, 2013 at 7:54 am the prievious version of android google


Mir maps had some issues. they can be
solved if you follow the tutorial of android
google maps api ver 2.0

https://mirnauman.wordpress.com/2013/06/11/our-first-android-google-maps
-api-ver-2-0-application-part-1/

this has step by step solution to everything.

Reply

July 19, 2013 at 6:48 pm Hi Mir, you are a very decent guy, thank
Nilton Castro you very much!

Reply

L E A V E A R E P LY

http://mirnauman.wordpress.com/2012/01/26/how-to-get-google-maps-api-key-for-an... 08/10/2013

You might also like