Pregunta

May be basic question but i don't know this and searched and didn't find clear answer. so asking here. I have created one google map v2 api key and running that in my machine(ubuntu) for my android project. It's working fine and map is getting displayed. But when i am running the same code in another machine then map is not showing. Then i created the api key for that machine using SH1 key print of that machine and map is getting displayed. So any way to run the same code in different machine without creating the key for each individual machine. Please Help !!! if any doubt in question, please ask.

¿Fue útil?

Solución

All Android applications must be signed with a digital certificate for which you hold the private key. Because digital certificates are unique, they provide a simple way of uniquely identifying your app.

This makes them useful for tracking your application in systems such as Google Play Store, and for tracking your application's use of resources such as the Google Maps servers.

Written in Offical Document

Maps API keys are linked to specific certificate/package pairs, rather than to users or applications. You only need one key for each certificate, no matter how many users you have for an application. Applications that use the same certificate can use the same API key. However, the recommended practice is to sign each of your applications with a different certificate and get a different key for each one.

Each machine is having different debug certificates which is used to sign the build, debug.keystore which you can check at: c:\users.android\debug.keystore.

Otros consejos

FYI, Each machine is having different debug certificates which is used to sign the build, I am talking about debug.keystore which you can check at: c:\users\your_user.android\debug.keystore.

As you have already generated Map API key, hope you remember Map API key is linked to such debug certificate which won't work on different machine if you use a different certificate.

A Simple solution you can do is: Share your certificate or generate another map api key based on your debug.keystore.

One more thing, you have to sign the final build (i.e. Release) which you will be uploading on play store, must be signed with release certificate (keystore).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top