所以我过去两天一直试图处理这个GreyGridOfDoom™而没有结果。我已阅读了数十篇SO帖子,并跳过至少一百篇有关该主题的Google搜索结果。
到目前为止的故事:
所以是的。我有一种直觉,我有一个糟糕的API密钥,但我真的不确定。
见下我的相关代码:
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>
在这里,我基本上是关于这个问题的猿,只是垃圾邮件包名称,看看是不是问题... Api Access screenshot
所以,如果任何人都可以解决这个问题,那我就是最幸福的人。由于目前我还没有解决方案,因此我现在会对此页面进行大量更新。我只是想不出来:&lt;
编辑: 更多信息:
应用程序输出
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
答案 0 :(得分:1)
从MapActivity更改为FragmentActivity后,我遇到了这个错误。然后我遇到了另一个错误,声称我的项目没有/无法找到Google Play服务。在这一刻,我开始怀疑,如果模拟器是原因,所以我尝试将新版本部署到我们在办公室的开发电话和它工作的BOOM。因此,如果您收到此错误而无法解决问题,我建议大家尝试使用Fragment方式创建地图。