Google Maps are not showing up in a signed apk

后端 未结 5 1788
广开言路
广开言路 2020-12-23 15:46

I know this is a common question and usually the solution is to generate a separate key for release. I\'ve done it several times and my API key in developers console contain

5条回答
  •  长情又很酷
    2020-12-23 16:26

    I did a lot of things to fix these but any solution not fix my problem to fix these issue I did these things

    1. Create signed apk with new keystore file make sure that the you will create that in release mode
    2. After creating the signed apk you should note the keystore path where you save your keystore file.
    3. You also need to use your google map API key with your release mode and debug mode both, you can use same API key with both but make sure that you should add two different sha keys for your single api key on google console.
    4. You should go to use the path of bin folder of java from c drive because keystore tool is inside bin folder so suppose your file is like C:\Program Files\Java\jdk1.8.0_11\bin so you should follow this path to your android studio terminal change the path to C:\Program Files\Java\jdk1.8.0_11\bin and then type this command:

      keytool -list -v -keystore "/Users/NT/Desktop/generalkey.jks"(adress of your keystore file)
      
    5. Now by doing these you will get the sha key copy that key

    6. Go to google console/credentials
    7. Now go to your api you will see edit option go to edit and past your sha key into it and save it .
    8. Run your code.

提交回复
热议问题