Google MapView not appearing in my app when using a debug build from two different sources

Today I got to the bottom of an issue that I’d semi been looking into for a week or so. I am doing some development using Google Map v2 and I noticed that it was working fine when I ran the debug build direct from Android Studio, the map displayed perfectly. However, when I deployed the debug apk created from either Jenkins or another development machine the maps didn’t appear at all. I had the Google logo in the bottom left corner and that was it.

It felt like a map api key issue but I couldn’t quite work out what. It was only when I noticed that I was getting a warning when deploying the app from another development machine saying “re-installation failed due to different application signature” that I put two and two together.

The issue was my original machine had the debug.keystore file in .android however, on the other machine the debug.keystore would be different. So the fix was to take my debug.keystore and put it into source control along with my release.keystore file and update the app gradle build config to use the one from source control with the following configuration.

signingConfigs {
  debug {
    storeFile file(“keystore/debug.keystore”)

release {
    storeFile file(“keystore/release-key.keystore”)
    storePassword “*********”
    keyAlias “my_alias_name”
    keyPassword “******”