请有人帮忙,我已经按照我找到的关于在 android 程序/设备上显示 Google Maps API 的每个教程进行操作,但无法使其正常工作。
在我最近的尝试中,我收到运行时错误“无法启动活动 ComponentInfo”
11-06 11:46:36.832: E/AndroidRuntime(24596): FATAL EXCEPTION: main
11-06 11:46:36.832: E/AndroidRuntime(24596): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.maptest/com.example.maptest.MainActivity}: android.view.InflateException: Binary XML file line #17: Error inflating class fragment
11-06 11:46:36.832: E/AndroidRuntime(24596): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
11-06 11:46:36.832: E/AndroidRuntime(24596): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="@+id/header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
<fragment
android:id="@+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_below="@+id/header"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
提前感谢您的任何帮助。