Friday, December 21, 2012

Google Maps Android API v2 with blank map displayed, wrong API Key assigned.

If you use Google Maps Android API v2, but with a blank (gray) map displayed (like the screen shown below), and "E/Google Maps Android API(12676): Authorization failure" reported in LogCat; may be caused by a wrong API Key assigned.

Google Maps Android API v2 with blank map displayed, wrong API Key assigned.


In order to use Maps Android API, you have to assign a API Key in AndroidManifest.xml.
        <meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="your API Key here"/>


You have to assign Debug API Key in testing, and Release API Key when release APK. Just insert the correct API Key, clean and rebuild your project should be OK. It's suggested to un-install your old app in device before re-load.



The series:
A simple example using Google Maps Android API v2, step by step.

No comments:

Post a Comment