我無法使用google map v2片段創建活動。自定義片段工作正常,這只是一個MapFragment的問題。MvvmCross與MapFragment
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment
class="com.google.android.gms.maps.SupportMapFragment"
android:id="@+id/mapfragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
以下是錯誤:
mvx:Diagnostic: 36.27 Showing ViewModel TruckWashMapViewModel
[0:] mvx:Diagnostic: 36.27 Showing ViewModel TruckWashMapViewModel
07-03 17:24:51.184 I/mono-stdout(16230): mvx:Diagnostic: 36.27 Showing ViewModel TruckWashMapViewModel
07-03 17:24:51.214 I/Choreographer(16230): Skipped 297 frames! The application may be doing too much work on its main thread.
Resolved pending breakpoint at 'c:\_Application\BLUBCNMOBL\src\BLUBCNMOBL.Droid\Views\TruckWashMapView.cs:17,1' to OnCreate [0x00001].
[0:] mvx:Diagnostic: 40.71 Loading new ViewModel from Intent with Extras
[0:] mvx:Diagnostic: 40.71 Loading new ViewModel from Intent with Extras
07-03 17:24:55.629 I/mono-stdout(16230): mvx:Diagnostic: 40.71 Loading new ViewModel from Intent with Extras
[0:]
MvxBind:Error: 42.60 View type not found - fragment
[0:] MvxBind:Error: 42.60 View type not found - fragment
07-03 17:24:57.511 I/mono-stdout(16230): MvxBind:Error: 42.60 View type not found - fragment
通過堆棧跟蹤翻翻進一步,它看起來就像是用API密鑰錯誤。但是我在AndroidManifest.xml中有我的API密鑰。
07-05 14:55:02.231 I/MonoDroid(31877): Caused by: java.lang.RuntimeException: API key not found. Check that <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml
AndroidManifest.xml中
<application android:icon="@drawable/logo"
android:debuggable="true"
android:enabled="true"
android:persistent="false"
android:allowClearUserData="true">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="xxx" />
哇。這也打動了我 - 謝謝你。 – wgraham
同一個盲人混蛋在這裏:) –