1

これは私のXMLファイルです:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

    <com.google.android.maps.MapView
          android:id="@+id/mvMain"
                 android:layout_width="fill_parent"
                 android:layout_height="fill_parent"
                 android:clickable="true"
                 android:apiKey="MAP API KEY" />
</RelativeLayout>

Ant Editor では、問題がここにあることが示されています: android:layout_height="fill_parent" > しかし、そうではありません。そして、これはマニフェストです:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.natasamisic.maptest"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="15" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
         android:theme="@android:style/Theme.NoTitleBar">
        <uses-library android:name="com.google.android.maps" />
        <activity
            android:name=".Main"
            android:label="@string/title_activity_main" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

プロジェクトをクリーンアップしようとしましたが、まだ機能しません。実行しようとすると、console:Error in an XML file: aborting build に表示されます。

新しい空白の XML ファイルmain.out.xmlを表示します...

私は何をすべきか?私のMain.javaは大丈夫です。問題は XML の何かです。Eclipse のバグかもしれません。解決方法がわかりません。助けてください...

4

1 に答える 1

0

main.out.xmlを削除し、プロジェクト フォームを消去しますMenu -> Project -> Clean

その後RightClick on Project -> Run as -> Android Application

于 2012-07-26T11:04:08.523 に答える