1

I am trying to create a map app with the GOOGLE API, for use on android devices, but I'm fairly new to this so have been following tutorials to get me started. I fixed my initial problem, however another one has appeared and I can't find what's wrong / how to change it!

When running the app through a mobile, it loads onto the phone fine, a screen loads (the sort of beige colour you see when google maps is loading) as well as the logo and zoom controls. But stops after this and displays the following error in LogCat:

Authorization Failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.

Ensure that the following correspond to what is in the API Console: Package Name: com.example.myapp, API Key: [my api key], Certificate Fingerprint [my code]

Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

I have completed the steps on the link and checked my code and made sure all those details match, but it's still not working.

This is probably a very basic error, but how would I go about resolving this / Am I looking in the correct place?

[Code no longer here; had to delete it]

hturner
  • 215
  • 3
  • 7
  • 19
  • Did you check the permission of the app? – wf9a5m75 Jan 21 '14 at 19:17
  • take look on this thread http://stackoverflow.com/questions/17147767/android-google-map-doesnt-display – mohammed momn Jan 21 '14 at 19:18
  • Paste your code and manifest. – Zohra Khan Jan 21 '14 at 19:26
  • @mohammedmomn I have followed the link and it was the second option I hadn't done; I had chosen an Android x.x. version, however with this it is throwing back a 'Fatal Exception' now – hturner Jan 22 '14 at 00:23
  • could you post the full error message ? – mohammed momn Jan 22 '14 at 00:26
  • @mohammedmomn Just realised the error was not from what I have just said, but because I missed out something out in my code. The following is showing in the LOGCAT: – hturner Jan 22 '14 at 00:55
  • @mohammedmomn I/Google Maps Android API(2836): Failed to contact Google servers. Another attempt will be made when connectivity is established. D/libEGL(2836): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so D/libEGL(2836): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so D/libEGL(2836): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so D/OpenGLRenderer(2836): Enabling debug mode 0 D/dalvikvm(2836): GC_FOR_ALLOC freed 198K, 5% free 9095K/9543K, paused 31ms, total 31ms – hturner Jan 22 '14 at 00:58
  • this problem cause the google map services in google api console is not active try to active it and build project again – mohammed momn Jan 22 '14 at 19:11

2 Answers2

0

If you run the app through Eclipse with a USB connected device, you need to use the MAPs debug key. If you export the app and load the .apk on a device, that app would have to be compiled with the production key.

Larry
  • 396
  • 4
  • 7
  • Tip: make sure to enable both production and developer keys in the developer console. – danny117 Jan 21 '14 at 22:41
  • I am running the app on a USB connected phone and using the key I obtained at the start of the tutorial I was following. I assumed this was the map key. Is this the right one to use? Thanks – hturner Jan 22 '14 at 00:14
  • You registered com.example.myapp in the Google Console and chose Maps? You should really choose a unique name - perhaps com.example.myapp has already been used by someone. If you can paste the key that the Google console shows, it might help. – Larry Jan 22 '14 at 00:56
  • @Larry Thanks for the advice. I re-registered with a new name and key, uninstalled the app and tried again and it works. It seems like this was the problem all along. Thanks – hturner Jan 22 '14 at 18:45
0

Last resort: uninstall and re-install app. Clean and rebuild the project is also a good idea

Moreover, please make sure your API key was an Android key, not a browser or server key. Also check that the service is Google Maps API for Android V2, not Google Maps JavaScript API V2.

If you still get any problems, check your set-up against the top answer in this question: Google Maps API V2 - always get authentication error.

Community
  • 1
  • 1
Gavin
  • 4,458
  • 3
  • 24
  • 37