我正在使用 ADT 在 Eclipse Juno 中为 Android 开发一个应用程序。出于某种原因,我的程序突然出现错误(这很简单:我在菜单中添加了一些项目,仅此而已),出于某种原因,我的项目似乎出现了错误,因为尝试运行它导致失败,原因是我的项目包含错误。奇怪的是,我的菜单 XML 文件和我的主要活动都没有显示任何错误,只是整个项目。这反过来又会在我尝试清理我的项目时删除我的 R.java 文件。现在,当我尝试重新制作“图形”项目时,我在进行任何修改之前就收到了这个 DDMS 错误:
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - Graphics] Parser exception for /Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for /nfs/guille/groce/users/nicholsk/workspace3/Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
[2012-08-08 14:54:25 - Graphics] Parser exception for /Graphics/AndroidManifest.xml: The markup in the document following the root element must be well-formed.
我现在不知道是什么原因造成的。我没有对我的库进行任何修改。在此之前,我在另一个工作区中运行测试很好。谁能解释发生了什么?
这是我的清单:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.graphics"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
</manifest><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.graphics"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
</manifest><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.graphics"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
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>
这是我的主要布局,在这里我得到了 yugidroid 的回答中提到的错误:
<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" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>
<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" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="@string/hello_world"
tools:context=".MainActivity" />
</RelativeLayout>