4

My Android app works fine on device without signing but Once I export signed apk file maps no more render Do we need to create new API key for release even with V2 if yes please suggest any link that I should follow to create release API key

Sourabh Saldi
  • 3,567
  • 6
  • 34
  • 57

3 Answers3

12

You don't need a separate API key for your release signing key. The only thing you need to do, is adding SHA of release key on APIs Console, so you have two lines there instead of one:

D3:49:EF:3D:0E:...:D5:5F:59:46:11:C1:85;pl.mg6.android.maps.extensions.demo
C1:3A:96:3E:F8:...:4D:F1:52:77:D0:01:0E;pl.mg6.android.maps.extensions.demo
MaciejGórski
  • 22,187
  • 7
  • 70
  • 94
2

@MaciejGórski is correct. Below is small details to it.

In the Google Api console, where we have created the API KEY we have an option to add multiple finger prints to the same key. What I did was adding two SHA1 finger print for my debug keystore and release keystore and the same API key worked for me.

Note the below is for Ubuntu specifically:

  1. Get SHA1 for the debug using the below command

    keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
    
  2. For getting SHA1 for release the command changes to

    keytool -list -v -keystore /home/atul/Desktop/Learnings/Projects/TestApp/keystore.jks -alias test -storepass password -keypass password
    

where

/home/atul/Desktop/Learnings/Projects/TestApp/keystore.jks is the path where my keystore file for the signed apk is present

test is the key alias name used while genrating the signed key store

and password is the password used while signing the apk

Hope this helps. Happy coding :)

Atul O Holic
  • 6,692
  • 4
  • 39
  • 74
0

make sure that you have release key in your "google_maps_api.xml" file in release folder,

Go to you app > app > src > release > res > values > google_maps_api.xml and put your generated key in "google_maps_key" string .

somthing like this: AIzaSyC3I-3mVulW2TNw_vmil_wGdNj11w5rrFg

its work for me :)