问题描述:

Error : The markup in the document preceding the root element must be well-formed. How do I correct it ?

I have just started using eclipse and am building myfirstapp as per the instructions on developer.android.com.

<<<<<<< Original

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.example.myfirstapp"

android:versionCode="1"

android:versionName="1.0" >

<uses-sdk

android:minSdkVersion="8"

android:targetSdkVersion="21" />

<application

android:allowBackup="true"

android:icon="@drawable/ic_launcher"

android:label="@string/app_name"

android:theme="@style/AppTheme" >

<activity

android:name=".MainActivity"

android:label="@string/app_name" >

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

<activity

android:name=".DisplayMessageActivity"

android:label="@string/title_activity_display_message"

android:parentActivityName="com.example.myFirstApp.MainActivity" >

<meta-data

android:name="android.support.PARENT_ACTIVITY"

android:value="com.example.myFirstApp.MainActivity" />

</activity>

</application>

</manifest>

=======

<manifest xmlns:android="http://schemas.android.com/apk/res/android" >

<application>

<activity android:name="com.example.myfirstapp.DisplayMessageActivity"

android:label="@string/title_activity_display_message"

android:parentActivityName="com.example.myfirstapp.MainActivity">

<meta-data android:name="android.support.PARENT_ACTIVITY"

android:value="com.example.myfirstapp.MainActivity" />

</activity>

</application>

</manifest>

>>>>>>> Added

网友答案:

You need to remove the '<<<<<<< Original', the '=======', and the '>>>>>>> Added'. Those were most likely put there by a merge tool.

Make sure you keep the '' at the top of the file. For the rest, I don't know which parts from the original you want (the part at the top) and your new entries (below the '=======').

相关阅读:
Top