Android: Google Map v2 not showing map for release apk

后端 未结 16 1629
感情败类
感情败类 2020-12-08 16:04

My google map app works fine on device with debug google map API KEY but when I create signed apk for my app with release google map API KEY, it does not display map. To gen

16条回答
  •  感动是毒
    2020-12-08 16:34

    Debug certificate is different from your production certificate. You need to add both to your Google Maps key entry in your API console as seaparate row - each with the same packageId, but naturally different SHA1 hash.

    EDIT

    There's no limit of how many certificate fingerprints and package names are assigned to single Google Maps key, so unless you need this separated is's perfectly fine to have both development and production builds using the same key. In google console it would be like this (one sha1 is from debug cert, which is the same for all apps you build using this IDE, other is production cert):

    83:10:58:52:EF:3B:59:70:2B:28:9E:AE:4F:5E:1D:F0:7E:19:FB:F1;com.foo.bar
    AE:4F:5E:1D:F0:7E:19:FB:83:10:58:52:EF:3B:59:70:2B:28:9E:AA;com.foo.bar
    

    or even (but I do not recommend using same key for different apps):

    83:10:58:52:EF:3B:59:70:2B:28:9E:AE:4F:5E:1D:F0:7E:19:FB:F1;com.foobar.myapp
    AE:4F:5E:1D:F0:7E:19:FB:83:10:58:52:EF:3B:59:70:2B:28:9E:AA;com.foo.bar
    EF:3B:59:7E:19:FB:83:10:58:57:AE:4F:5E:1D:F0:2B:28:DE:9E:01;net.something.otherapp
    

提交回复
热议问题