Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does i need different SHA1 key to perform Google Map

Hj. I am using google map API v2 for project. In my office, it works fine with cert_fingerprint key 1

But when doing it in home, i got a blank google map. Trace log i can see this:

03-17 04:40:44.288 12461-12510/com.dump.dms E/Google Maps Android API﹕ In the Google Developer Console (https://console.developers.google.com) Ensure that the "Google Maps Android API v2" is enabled. Ensure that the following Android Key exists: API Key: AIzaSyDEE3COcEWPZte_cpPl*********L2Cm_A Android Application ( < cert_fingerprint > ;< package_name >): EF:FA:C1:36:BD:FA:D6:6A:DE: ** : ** : ** :53:C8:8B:16:C1:15:C7:ED;com.dump.dms (call cert_fingerprint key 2)

So i must to replace to cert_fingerprint key 2 . Then my app works normally.

Could anyone explain why i need 2 cert_fingerprint key like that? How can i use only one cert_fingerprint key ?

like image 853
Pham Hung Avatar asked Mar 16 '15 22:03

Pham Hung


1 Answers

When deploying your app as debug build, the problem is that at home your debug.keystore is different than at work. In your office, you used that debug.keystore to generate the SHA1 key which you used for generating the Google Maps API Key. When you deploy your app at home now, another debug.keystore is used and the key doesn't match.

The easiest way would be to copy your the debug.keystore file from your work environment and use it at home. But you can also enter multiple SHA1 keys in your Google API console like this (for every environment you use which means you need to create SHA1 keys for the debug.keystore files of all your environments):

AB:0A:05:...:12;com.example
CD:35:01:...:2B;com.example

The same problem appears when you deploy as release build (using the keystore file you need to generate when exporting your Android App as APK file)

See also: http://developer.android.com/tools/publishing/app-signing.html#debug-mode

like image 144
Daniel Avatar answered Sep 29 '22 20:09

Daniel