0

Androidスタジオを使用して、Googleマップv2をAndroidで動作させようとしています。すべてのキーとマニフェストのセットアップを取得しました。マップが表示される実際のアクティビティの xml を作成しようとすると、エラーが発生します。私の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"
                tools:context=".MainActivity" >

    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
              android:id="@+id/map"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              class="com.google.android.gms.maps.SupportMapFragment"/>
</RelativeLayout>

Androidスタジオでの私のエラーは次のようになります:

ここに画像の説明を入力

4

2 に答える 2

1

これは私にも起こります。プロジェクトをクリーンアップするだけです。

于 2013-08-24T14:47:40.410 に答える
-1

こんにちは、xml ファイルでこのコードを使用する必要があります。

<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
          android:id="@+id/map"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:name="com.google.android.gms.maps.SupportMapFragment"/>
于 2014-08-24T22:51:23.597 に答える