问题
I am working with the Google Map Android API v2
in an android application.
It works fine with the unsigned apk on a different device. But when I have signed the apk and uploaded my application to the Play Store the downloaded application displays a white screen instead of the map.
回答1:
What type of keystore you are using? there are two keys. Debug
and release key
. If you use debug key and uploaded in android market, map will look blank. Use release key when you signed your apk.
Release key procedure
Step 1:
Say for example your apk name is A and you are signing and creating a keystore for A.apk ie A.keystore will be created in some drive location.Let's consider it in E drive.
step 2:
Now locate to jdk in C drive(Considering for windows and assigning C drive)
C:\Program Files\Java\jdk1.7.0\bin>keytool -list -v -keystore E:\A.keystore -alias A
So it will create SHA-1 finger print.
回答2:
This happens because mapApi key is different for signed apk and unsigned apk.
You have to generate SHA1 key using your keystore with which you singned your apk.
Don't worry just follow the steps.
open terminal and fire command
keytool -list -alias -keystore -v
Alias name: abcd
Creation date: 15 Mar, 2013
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=abc, OU=abc, O=abc, L=abc, ST=abc, C=91
Issuer: CN=abc, OU=abc, O=abc, L=abc, ST=abc, C=91
Serial number: 5142a21d
Valid from: Fri Mar 15 09:52:53 IST 2013 until: Sat Mar 03 09:52:53 IST 2063
Certificate fingerprints:
MD5: D3:CA:6D:F4:5E:B6:E1:48:F1:D6:DB:C4:67:F5:C3:B2
SHA1: 03:D8:EF:05:04:CF:06:86:15:1A:F1:D3:B1:18:46:xx:xx:xx:xx:xx
Signature algorithm name: SHA1withRSA
Version: 3
Take SHA1 key from List
Open your google api console and generate new key and give SHA1 key with your packagename
03:D8:EF:05:04:CF:06:86:15:1A:F1:D3:B1:18:46:F5:xx:xx:xx:xx;yourpackagename
Put the new map api key in your code.
回答3:
what i have used for SHA1 key is
for debug key need to use from preference sha 1 finger print..
回答4:
Create release key for android map using the key you have used to create your release. It will work.
回答5:
Just check your google_maps_key under the src/release directory, you should place there your own key from the google console (the one you got with the release fingerprint SHA1).
来源:https://stackoverflow.com/questions/18395764/google-map-android-api-v2-cant-display-map-in-play-store-application