1

OK, I'm having the weirdest bug right now : the Android application I'm working on is displaying a grey background instead of the map, such as below :

WTF
(source: hostingpics.net)

Here's the logcat :

04-25 15:08:42.082: E/Google Maps Android API(19139): Failed to load map.  Could not contact Google servers.
04-25 15:08:42.082: W/Google Maps Android API(19139): Please add <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> into AndroidManifest.xml to ensure correct behavior under poor connectivity conditions.

I have NO idea what might have caused this. I only changed a small part of my code that was completely unrelated to the map. And besides, I tried reverting the changes I made, and it still didn't work. I tried adding the line the logcat gave me, changing the API key, re-installing the Google Play library, deleting the previous versions of my app on my tablet, basically pretty much everything that I read on the Internet. Still doesn't work.

If anyone has any idea what the problem might be, that would be great.

Community
  • 1
  • 1
Apoz
  • 503
  • 2
  • 10
  • 22

3 Answers3

3

This problem is caused when there is a problem with your key or a problem with it's configuration in the Google API Console.

Go over this blog post I wrote on how to produce the key and integrate in in the console:

Google Maps API V2 key

if this is not helpful you can try to delete the dubug.keystore folder in you user folder, compile some project in eclipe (which result in regenerating this key) and try to register it again.

UPDATE: From the new error you posted, do you have this permission in your manifest file:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Emil Adz
  • 40,709
  • 36
  • 140
  • 187
  • I don't think there's a problem with my SHA1 key because I have another project which uses it, and this it works perfectly. I also already tried generating a new key but it doesn't change anything. – Apoz Apr 25 '13 at 14:40
  • and what about the permission? – Emil Adz Apr 25 '13 at 14:41
  • 1
    try to register your SHA1 to a new project in the console and set the new API_Key you will receive in your project. – Emil Adz Apr 25 '13 at 14:45
1

Try this: set the “Custom debug keystore” setting (empty by default) to the same value as the “Default debug keystore” in the Eclipse preferences.

Nayan
  • 3,014
  • 2
  • 17
  • 33
wm26850436
  • 11
  • 1
0

Emil's post above helped me, I was getting the same error and realised that this was due to me changing the name of my project. I added the changed name along with the same SHA1 I had for my old project on a new line (leaving the one with the old name above) in the console and it seemed to work as normal.

tribal
  • 219
  • 3
  • 14