Search code examples
androiddevicegoogle-maps-android-api-2android-fragmentactivity

Android Maps - Authorization Failure


I am trying to build an application that uses Maps v2 for the first time. I have followed the Google tutorials, and have done exactly what the Stack Overflow community has advised others. I have

1) declared all of the permissions in my Manifest:

<permission
    android:name="com.myDomain.mapApp.permission.MAPS_RECEIVE"
    android:protectionLevel="signature"/>
<uses-permission android:name="com.paloaltoapps.findafib.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/>

2) enabled not only the Google Maps API v2 service, but also the Google Maps Android API v2 service for my API key.

3) the ability to see a blank frame for the map (a gray screen with the zoom controls)

4) This error output from the logcat:

06-20 15:18:46.404: E/Google Maps Android API(2469): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).

This is when I try running the app on my physical Galaxy Nexus. When I try the emulator, it DOESN'T give me this error, it gives me one about not having OpenGL 2. Is it something to do with the actual device? I'm pretty sure I set everything up correctly.

Thanks.


Solution

  • For future visitors: The way I worked it out was by scouting, and I found a great web tutorial with this link: http://blog-emildesign.rhcloud.com/?p=435

    It helped me out a lot. The 'secret' is to use a FragmentActivity.