vendredi 11 septembre 2015

Android - API key for GoogleMaps API V2 for release

I have trouble with GoogleAPI in my app. I use Google Maps and Places - both needs API key. Everything works fine, until I upload my signed app to Google Play. From what I know and from what I read so far, the API key has to have the same fingerprint as my signed app to work properly from app downloaded from GP. So I created a new API key, add two fingerprints with package name to this key. First with fingerprint from debug.keystore and second from fingerprint from my keystore which I'm using for singning app when I do release build (I'm using android studio ->generate signed apk). This way I assumed that this will work for debug and release, but it work only for debug. To be sure that fingerprint of my app is the same as I have under Google API key I have implemented method which extract fingreprint of my app on runtime. They are match - when I do debug release I see fingerpring "A", when I do it for release I see "B" and I have both of then are the same as fingerprints which I have under API key (section Restrict usage to your Android apps). Note that package name is also correct.

Summary I don't know what I'm missing, or why this is not working when fingerprints are matched - result after release build is that Places api indicates KEY_INVALID and maps is gray, without titles.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire