Android: Google Map v2 not showing map for release apk

后端 未结 16 1624
感情败类
感情败类 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:21

    Sorry for replying late. Hope this helps for future. I use this solution to solve same problem When we are using Google maps while developing, a default debug.keystore is used which has no password. When we build apk file to upload on Play store new SHA-1 key is made so we have to make new debug.keystore for that. We have to create new API key for that SHA-1. According to solution How to obtain Signing certificate fingerprint (SHA1) for OAuth 2.0 on Android? we can get SHA-1 for the exported apk file .

    After that use that new API key in Android Manifest as the previous one and you are done.

    EDIT 1-
    Steps to do this
    1) Create apk file using "Use the export Wizard" in "Android Manifest" file of your project.
    2) After inserting key and before finishing, MD5 and SHA1 keys are shown as shown is this given pic- (http://i.stack.imgur.com/SldEv.png)
    3) Create new API Key for Android project in https://console.developers.google.com for new SHA1 which is retrieved in point 2).
    4)Use that API key in manifest file as shown below

    5)Clean your project and build APK file again as per point 1).
    6) You can see google maps now in that apk.

提交回复
热议问题