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

前端 未结 5 1218
滥情空心
滥情空心 2020-11-30 08:02

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. B

5条回答
  •  -上瘾入骨i
    2020-11-30 08:42

    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.

提交回复
热议问题