-1

Possible Duplicate:
Google map can be displayed on emulator but not in Android Device

I want to get .apk file for final version, but when i install the program on the phone, the program does not shows the map but when i run the program in eclipse, the program runs correctly. I think, maybe the program doesn't have map libray. What is the problem? What should i do?

Community
  • 1
  • 1

2 Answers2

1

It's because you are deploying using the Google Maps Api key for debug, not for release.

You should read https://developers.google.com/maps/documentation/android/mapkey.

Hope it helps, and if you need more helps let me know.

Steps to generate apiKey for release:
1. Build Keystore - from eclipse > right click on project and then android tools > Export Signed Application Package 2. Open cmd and write

c:\Program Files (x86)\Java\jre7\bin > keytool -v -list -alias <your alias> -keystore <path to keystore>

where < your alias > is one used when generating the keystore
< path to keystore > to path where you have placed the keystore
This command can be different for you.

You will get the MD5 code needed for generating the api key.

Hope this helps.

Adrian C.
  • 1,647
  • 1
  • 23
  • 27
  • I obtain apiKey and i write my apiKey to my prgram but finla version not shows map. Do may i fill fields with incorrect information? – Pariya Daghoghi Nov 01 '12 at 15:37
  • @PariyaDaghoghi: Just read the freaking instructions on the given page. You might have 2 API keys: one related to your debug signing certificate, the other related to your "export" signing certificate. – OcuS Nov 01 '12 at 15:39
  • Did you got apiKey for android debug.keystore and for jre? I had the same problems when building the apk and forget to change apiKey from debug to release. If you didn't do both, you will have to build a keystore from eclipse (right click on project and then android tools > Export Signed Application Package) and then execute in cmd something similar to this command : c:\Program Files (x86)\Java\jre7\bin > keytool -v -list -alias -keystore where yourAlias is one used when exporting from eclipse – Adrian C. Nov 01 '12 at 15:41
  • Thanks for help but i don't understand what do you mean about your alias!! how i find this?? what is between bin and keytool? Thanks – Pariya Daghoghi Nov 01 '12 at 16:00
  • You should check [this](http://techdroid.kbeanie.com/2010/02/sign-your-android-applications-for.html) tutorial for creating keystore (with alias) in eclipse. If you want, you can read [Signing Your Applications](http://developer.android.com/tools/publishing/app-signing.html) – Adrian C. Nov 01 '12 at 16:17
  • I lost directory of keysotre! what should i do?? – Pariya Daghoghi Nov 01 '12 at 16:29
  • @Pariya Daghoghi Search it in windows or create another one :) – Adrian C. Nov 01 '12 at 16:30
  • When i write this in cmd, cmd has errors. If i write C:\Program Files (x86)\Java\jre7\bin in front C:\Users\Fahimeh> . but cmd writes C:\Programs is not recognized as an internal or external command. WHy? WHat is the problem? – Pariya Daghoghi Nov 01 '12 at 16:57
  • You need to navigate using commands to c:\Program Files (x86)\Java\jre7\bin and there you will write your command. To Navigate backward you will write cd.. and forward eg.: cd Program Files (x86) – Adrian C. Nov 01 '12 at 17:01
  • Thank you. I write this and i'm sure directory address and alias is true but cmd write The syntax of the command is incorrect. – Pariya Daghoghi Nov 01 '12 at 17:16
  • keytool -v -list -alias pariya -keystore e:\name.keystore. I tested this command right now on Windows 7 and works. – Adrian C. Nov 01 '12 at 17:20
0

Thanks I write this and cmd not write MD5! I put pictur cmd in below. cmd

  • check if you typed correct. Before keytool -list you probably have an illegal option caused by a misspelling – Adrian C. Nov 01 '12 at 20:37