3

I develop locally with android-studio and a Galaxy S3 android phone connected via USB.

On my local development environment, when I fire up the run configuration to deploy on the S3, everything works fine - the map shows up just fine.

But when I deploy as signed APK to our server, and install via Internet (I am trying on another android phone to keep things clearly separated), the map tiles don't load, I see the Google sign to the lower left and the GPS location icon on the upper right corner.

I've seen a few related posts:

Android Google Maps application showing grey background instead of the map

which seems first a bit dated, second he uses eclipse (I am using android-studio), third - it didn't work for me.

Android - Google Maps Grey Screen on Signed APK This guy didn't get any useful answers to his question....

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
transient_loop
  • 5,984
  • 15
  • 58
  • 117
  • 2
    Google Maps API v2 right ? Did you use the Google Maps' production key for your signed apk ? – Jayesh Elamgodil May 26 '15 at 15:00
  • yes, Google Maps API v2. hmm...can't see any production key though. When I go to the google developer console, there's just a key there, "Key for Android applications" - I can't see any reference to a production or a debug key. Where would that be? – transient_loop May 26 '15 at 15:03
  • API key for one device does not work on another device (if you made debug api key), release API keys work on all devices, so you have to make a release api key – kzs May 26 '15 at 15:04

2 Answers2

2

The first step is to get the SHA1 value for the key that you used to sign the release version of your app using the keytool command line tool.

keytool -list -v -keystore ~/Keystore/key1.jks -storepass <your_store_password> -keypass <your_key_password> 

Replace ~/Keystore/key1.jks with the path and name of the keystore that you used to sign your release version, and replace the passwords with your own.

When you execute this command at the command line, it will list the Certificate Fingerprints, including the SHA1 value that you need.

The next step is to add the SHA1 and package name to a key in the Google Developers Console.

You can either add it to the same key you used for debug builds, or you can create a new key.

To add your release SHA1 and package name to an existing API key, click the Add package name and fingerprint button, and add your SHA1 value and package name.

Then, you can use this API key with the signed release version of your app.

For more information on how to configure your app if you use a different API key for debug and release, see here.

Community
  • 1
  • 1
Daniel Nugent
  • 43,104
  • 15
  • 109
  • 137
1

Step 1: Follow the instructions from here:

http://developer.xamarin.com/guides/android/platform_features/maps_and_location/maps/obtaining_a_google_maps_api_key/

Step 2: Then from your Android Studio, follow the steps described here:

https://www.udacity.com/wiki/ud853/course_resources/creating-a-signed-apk

I faced a similar problem and had it solved by doing the above.

kzs
  • 1,111
  • 5
  • 20
  • 35
  • Thanks Peter, I guess the links will have the same results as Nugent's answer, but having them right there to follow made my day, so accepted his and upvoted your answer :) – transient_loop May 26 '15 at 17:29