Google Maps API v2: All i get is an empty map

If you have correctly done all the steps to configure your GoogleMap, and you just see an empty map with a [+/-] zoom control, you probably havent registered your debug key in Google APIs console.

To find your debug SHA1 key:

running a terminal inside HOME directory (Linux: /home/user/, Windows: C:\Users\user\, etc)

 

keytool -list -v -keystore .android/debug.keystore

It will ask you for a password, leave it empty and press enter. You will see the SHA1 key, that looks like this:

Certificate fingerprints:
 MD5: BA:3C:6D:7A:4C:4A:AD:3E:65:DB:53:D1:3A:23:A3:4D
 SHA1: B5:38:93:50:7C:EA:55:23:51:1E:BC:EE:AA:A5:6D:A8:6C:B7:16:35

To register the debug SHA1 as allowed app in Google APIs Console

Now, on Google APIs console, go to the “API Access” section and generate a new allowed key for an app. As the value, attach your app’s package name to the SHA1 key separated by a | character. Like this.:

B5:38:93:50:7C:EA:55:23:51:1E:BC:EE:AA:A5:6D:A8:6C:B7:16:35|com.example.mymapsproject

So now, your allowed apps list should look like this:

Key for Android apps (with certificates)
 API key:
 Whatever_the_api_key_is
 Android apps:
 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX;com.example.mymapsproject
 B5:38:93:50:7C:EA:55:23:51:1E:BC:EE:AA:A5:6D:A8:6C:B7:16:35;com.example.mymapsproject
 Activated on: Date, Time

one line for the “production” signature, and another line for the debug signature. Note that the character beetween the SHA1 and the package name used to be “|” for previous versions of Google APIs, but now is a semicolon “;”.

Hope it helps!

original source

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s