11

We are using a Google MapView in our application but on different computers we must use different API keys, otherwise the MapView doesn't display anything.

Is there a way to set one key for all developers?

mate64
  • 9,876
  • 17
  • 64
  • 96
skayred
  • 10,603
  • 10
  • 52
  • 94

2 Answers2

18

Is there a way to set one key for all developers?

For the debug signing key, copy your debug keystore (e.g., ~/.android/debug.keystore) between developer PCs, and remember to update all of them again when that keystore expires.

For the production signing key, copy the production keystore between developer PCs.

Note that I have not tried copying keystores between Windows and non-Windows (OS X, Linux), so I don't know if there are any possible issues there related to line endings.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • would you mine elaborating just a tiny bit. I was under the impression api key was based on the JDK, but this makes it seem like its based on the keystore. We just ran into this issue and I always used multiple API's, but now w/ version control, more people etc.. ugh.. – DJPlayer Feb 02 '12 at 16:53
  • API Key *is* based on the keystore, so you must copy the debug.keystore being used to every member of the team. The production one only needs to be handed out to whomever handles the "official builds". Copying between Windows and OS X confirmed working, at least (keystore created on the Win7 machine). – Uncle Code Monkey Jun 26 '13 at 17:53
  • 1
    I am also having almost same isuue..I am able to login to google in the app through build generated from my computer but if someone else from my team is generating build on his computer than he is not able to login AND WE ARE USING SAME DEBUG.KEYSTORE..I created Client ID by specifying my project package name and SHA-1 fingerprint at developer console and also created consent screen.Am i missing something on developer console?Any idea why i am facing this issue?Thanks.. – Android Developer Feb 22 '15 at 08:08
  • I have tried transferring the file between my Windows laptop and my Mac at work and it works fine. I was having the same issue. This helped a ton thanks for the post. – MGHandy Mar 07 '16 at 16:10
  • Thanks, this worked. We have added multiple developers to a mobile team and started to share the repository. Copying the debug.keystore file between OSX installs did the trick. We may need to make sure a copy of this in included in the GIT repository. – Big Kahuna May 10 '16 at 22:06
13

Yes you can use common key to make MapView visible in all Device by using Release Key.

  1. Get the MD5 Key from your computer and Go to Googles link for getting Map Key and get your Unique key for your system.
  2. Copy and paste it in XML file
  3. Now right click Project->Export Application->Select your Project->Next->Select new Keystore -> Complete all rest Steps
  4. Note down your alias name and password given.
  5. Now if you Complete all process of Filling Details you will get one .apk file and keystore file in your stored location.
  6. Now open commamd prompt type this command in it --> Got to you Java bin path -> keytool.exe -list -alias "aliasname" -keystore "location of keystore generated" -storepass "password" -keypass "password"
  7. Now hit ENTER you will get MD5 again
  8. Now copy it paste it in in Google Key link and get your key.
  9. Now go to your XML put the new key in XML file.
  10. Now Right Click Project->Export Application->Select your Project->Next->Use Existing Keystore -> Give location and password->Next
  11. Now your alias name will comes in your Drop Down->Select it -> Enter Password -> Next
  12. It will ask for location to store your final .apk file.
  13. Select your location and store.
  14. Now this final .apk file will shows MAPVIEW in all Devices.

     C:\Users\FSSD6>keytool.exe -list -alias aliasname -keystore "location" -storepass password -keypass password
    

For Further help check this Maplink and this blog post

Jeromy French
  • 11,812
  • 19
  • 76
  • 129
Venky
  • 11,049
  • 5
  • 49
  • 66