Android Google Maps not showing in signed apk V2

My Android application works fine on a device without a subscription, but after I exported the signed apk file files, there is no more. Do we need to create a new API key for release even with V2, if so, please offer any link I should use to create a release API key.

+4
source share
3 answers

You do not need a separate API key for your release signature key. The only thing you need to do is add the SHA of the release key to the APIs Console , so instead of two you use two lines:

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 
+12
source

@ MaciejGórski is true. Below are some small details.

In the Google Api console, where we created the KEY API, we have the ability to add multiple fingerprints to the same key. What I did was add two SHA1 fingerprints for my debug keystore and free the keystore, and the same API key worked for me.

Please note: below for Ubuntu:

  • Get SHA1 for debugging using the following command

     keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android 
  • To get SHA1 for release, the command will change 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 key file for signed apk is present

test is the key alias name used to generate the signed keystore

and password is the password used when signing apk

Hope this helps. Happy coding :)

+2
source

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

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

Something like this: AIzaSyC3I-3mVulW2TNw_vmil_wGdNj11w5rrFg

his work is for me :)

0
source

Source: https://habr.com/ru/post/1485465/


All Articles