3

So I've been trying to deal with this GreyGridOfDoom™ for the past two days with no results. I've read through tens of SO posts and skipped through at least a hundred Google search results about the topic.

The story so far:

  • I have the Android API Key from the Google API ACCESS website.
  • I can get the GGOD but no map data. Zoom keys and and so forth work just fine.
  • I have tried maybe 15 different solutions so far.
  • I have made several AVDs with different GOOGLE API versions, but none have worked any different. To be accurate I have tried 8-14.
  • In the log "[MapActivity] Couldn't get connection factory client" is the point where all hell breaks loose.
  • I am using MapActivity and the latest Google Play Services.
  • My key is generated using the debug.keystore found in .android folder.

So yeah. I have a gut feeling I have a bad API Key, but I really am not sure about that.

Heres my relevant code:

MapsActivity.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using Android.Support.V4.App;
    using Android.App;
    using Android.Content;
    using Android.OS;
    using Android.Runtime;
    using Android.Views;
    using Android.Widget;
    using Android.GoogleMaps;

    namespace IgluHarkka2
    {
        [Activity (Label = "MapsActivity", MainLauncher = true)]            
        public class MapsActivity : MapActivity
        {
            protected override void OnCreate(Bundle bundle)
            {
                base.OnCreate(bundle);
                SetContentView(Resource.Layout.Map);
                MapView mapView = (MapView) FindViewById(Resource.Id.mapView);
                mapView.SetBuiltInZoomControls (true);
            }

            protected override bool IsRouteDisplayed 
            {
                get {return false;}
            }
        }
    }

Map.xml

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <com.google.android.maps.MapView
            android:id="@+id/mapView"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:enabled="true"
            android:clickable="true"
            android:apiKey="XXXXXXXXXX" />
    </RelativeLayout>

AndroidManifest.xml

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="IgluHarkka2.IgluHarkka2">
                <uses-sdk android:minSdkVersion="7" />
            <application android:label="IgluHarkka2">
                <uses-library android:name="com.google.android.maps" />  
            </application>
                <permission android:name="com.IgluHarkka2.IgluHarkka2.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>  

                <uses-permission android:name="android.permission.INTERNET" />
                <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
                <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
                <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
                <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" />
        </manifest>

Here I'm basically going ape about the problem and just spamming package names to see if that's the problem... Api Access screenshot

So if ANYONE can solve this problem I'd be pretty much the happiest person alive. I'll be refreshing this page a lot now since I have no solutions at the moment. I just can't figure this out :<

EDIT: More information:

Application output

    Forwarding debugger port 8897
    Forwarding console port 8898
    Detecting existing process
    [monodroid-gc] GREF GC Threshold: 1800
    Loaded assembly: IgluHarkka2.dll
    Loaded assembly: GooglePlayServicesLib.dll [External]
    Loaded assembly: Newtonsoft.Json.dll [External]
    Loaded assembly: Mono.Android.GoogleMaps.dll [External]
    Loaded assembly: Mono.Android.dll [External]
    [MonoDroid] Xamarin/Android Trial Mode Active
    [dalvikvm-heap] Grow heap (frag case) to 7.236MB for 441776-byte allocation
    [gralloc_goldfish] Emulator without GPU emulation detected.
    Loaded assembly: System.Core.dll [External]
    Loaded assembly: MonoDroidConstructors [External]
    [CursorWrapperInner] Cursor finalized without prior close()
    [CursorWrapperInner] Cursor finalized without prior close()
    [MapActivity] Handling network change notification:CONNECTED
    [MapActivity] Couldn't get connection factory client
    [System.err] IOException processing: 26
    [System.err] java.io.IOException: Server returned: 3
    [System.err]    at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
    [System.err]    at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
    [System.err]    at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
    [System.err]    at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
    [System.err]    at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
    [System.err]    at java.lang.Thread.run(Thread.java:856)

Screenshot of the emulator: Screenshot

Tibelius
  • 63
  • 1
  • 7
  • Did you check http://stackoverflow.com/questions/7296467/google-map-signed-api-key-errors-in-android? Sounds like it is exactly your error. – Daniel Hilgarth Aug 07 '13 at 07:49
  • Yeah. The problem is I'm not using Eclipse and I already used the debug.keystore. So I don't think that post really applies here. – Tibelius Aug 07 '13 at 07:59
  • Should I somehow generate a new debug.keystore and use the SHA1 fingerprint from the new one to create a new API key? If that's the case, I'm not really sure how to get a new keystore with Xamarin. – Tibelius Aug 07 '13 at 08:03
  • Check the error numbers you are getting. They are exactly the same as in your case. It has to be something similar. Try reading through the other answers in this question, maybe they contain a clue as to what you are missing. – Daniel Hilgarth Aug 07 '13 at 08:04
  • Well honestly the only thing from that question I haven't actually tried is creating a new debug.keystore, but I have no idea how to do that. I tried searching info on that subject yesterday, but I didn't figure out how to do that on Xamarin. – Tibelius Aug 07 '13 at 08:12
  • But yeah I agree that the error numbers are the same and that the general problem seems the same. That's why I am so dumbstruck by this. Seems like nothing works. – Tibelius Aug 07 '13 at 08:16
  • check if [this situation](http://stackoverflow.com/questions/17679317/android-google-maps-v2-authentication-error/17684309#17684309) applies to your case. – tony m Aug 08 '13 at 03:04
  • Deleted all my apps from the emulator I use and still all I see is the grey grid. – Tibelius Aug 08 '13 at 04:15

1 Answers1

1

After changing from MapActivity to FragmentActivity I got past this error. Then I encountered another error, claiming that my project does not have/can't find Google Play Services. At this moment I started wondering, if the emulator was the reason, so I tried deploying the new version to a dev phone we have at the office and BOOM it works. Therefore I'd recommend everyone to try the Fragment way of creating the map if you are getting this error with no way to fix it.

Tibelius
  • 63
  • 1
  • 7