2

I am confused from the thing which I have experienced

I use Google Map API v2 for my application. I have use the map fragment to display the map. It works fine on many of devices above to 2.2. It works perfectly when running direct to device but when I export application to a *.apk and then install into the device, run the application, It only show white screen.....

I have search for this problem, the solution comes that use API KEY with the signing of apk. I dont know how to sign the apk? And what is the release key?

Please help me I am stuck from last 2 days. Thanks in advance..

Facing this error..

enter image description here

UPDATE :

My mistake is that I have not used the SHA fingerprint which is generated when apk is created. It is displayed first time in the console and next time on to the apk export screen.

Here are screen shots of the same

FIRST TIME OF APK CREATION :

enter image description here

NEXT TIME :

enter image description here

Thanks everyone for your valuable suggestions and responses. Thanks.

Swapnil Sonar
  • 2,232
  • 2
  • 29
  • 42

5 Answers5

2

You need to do the following things to get your Maps Visible for both Debug Mode and release mode

-1 Add debug key to package combination at Google API console

-2 Add release key to page combination at Google API Console

Note : you need to add at lease 2 combination to get your maps visible when you are testing and when you generate *.apk file. What you are missing right now is not adding the release key to application package combination to API console add this and after that do the following:

replace your debug map key with release key and generate your *.apk and install aplication to your device you will get your maps there are several Tutorial available on net i would to suggest you the following one Google Maps

To Generate the Release key do the following steps Open CMD (in Windows) terminal (in Linux?MAC os) find the path to your jdk dir and then to bin like following:

C:\path-to-jdk\jdk1.7.0_07\bin>keytool -v -list -alias tt -keystore path-to-keystore -storepass password -keypass passowrd

for me the path is following for Jdk/bin and that for key store

C:\Program Files\Java\jdk1.7.0_07\bin>keytool -v -list -alias tt -keystore D:\ke yStore -storepass password -keypass password

you need to give the following things of your own

-1 path to jdk

-2 path to keystore

-3 keystore passoword

-4 keypass password

Usman Kurd
  • 7,212
  • 7
  • 57
  • 86
  • Thanks for replaying but I followed http://android-er.blogspot.in/2012/12/displaying-sha1-certificate-fingerprint.html tutorial and I failed in generating the release key.. Is this same steps to create a release key?? – Swapnil Sonar Oct 25 '13 at 13:30
0

You can generate api key here: https://code.google.com/apis/console/

About release key, it's this article: http://developer.android.com/tools/publishing/app-signing.html But this is not required, default sign by debug.keystore. Below nice tutorial about this.

Here is official Google tutorial about map v.2: https://developers.google.com/maps/documentation/android/start

artemiygrn
  • 1,036
  • 7
  • 18
0

I have a good tutorial regarding this, each step is explained via screenshot http://androidstudies.wordpress.com/2013/05/30/view-map-in-you-android-applicatiopn/ actually Api key is for security purpose so that no fake requests are sent to google server(some times hackers do such things)

0

There are two keys.Debug and release key. Debug key works for unsigned apk and release key works for signed apk. If you signed your apk by means of debug key, then your map looks blank. So if you export your application, use release key.

Release key procedure, you can follow here.

Google Map Android API v2 can't display map in play store application

Community
  • 1
  • 1
Shadow
  • 6,864
  • 6
  • 44
  • 93
0

Follow this step by step process:

step1:Create key store

C:\Program Files\Java\jdk1.7.0_21\bin>keytool -genkey -v -keystore keystorename.ke ystore -alias pwd -keyalg RSA -keysize 2048 -validity 10000

step2: convert all required android projects to ant project to run 'ant release'

E:\myworkspace\sample\myproject>android update project --path .

step3:Run ant release

E:\myworkspace\sample\myproject>ant release

Step 4: Sign apk

E:\myworkspace\sample\myproject>jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore path\to\keystore path\to\generate\unsigned.apk pwd

Step 5: verify signed jar

E:\myworkspace\sample\myproject>jarsigner -verify -verbose -certs path\to\generate\unsigned.apk

Step 6: align apk

E:\myworkspace\sample\myproject>zipalign -v 4 path\to\generate\unsigned.apk "path\to\final\released\final.apk"

Refer this link: http://developer.android.com/tools/publishing/app-signing.html

Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138