"错误解析XML:XML声明格式不正确" [机器人]

时间:2014-04-26 15:52:46

标签: android android-manifest

我的AndroidManifest.xml文件中出现了标题错误。

错误出现在< / manifest>。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.contactpicker"
    <uses-permission android:name="android.permission.READ_CONTACTS"/>
    <application android:icon="@drawable/ic_launcher">
     <activity android:name=".ContactPicker" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.PICK"></action>
                <category android:name="android.intent.category.DEFAULT"></category>
                <data android:path="contacts" android:scheme="content"></data>
            </intent-filter>
        </activity>
    <activity android:name="com.example.contactpicker.ContactPickerTester"
              android:label="@string/title_activity_contact_picker_tester" >     
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER"  />
            </intent-filter>
        </activity>
    </application>

</manifest>

2 个答案:

答案 0 :(得分:4)

关闭清单标记。添加&gt;

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

答案 1 :(得分:0)

试试这个:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.contactpicker">
    <uses-permission android:name="android.permission.READ_CONTACTS"/>
    <application android:icon="@drawable/ic_launcher">
     <activity android:name=".ContactPicker" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.PICK"></action>
                <category android:name="android.intent.category.DEFAULT"></category>
                <data android:path="contacts" android:scheme="content"></data>
            </intent-filter>
        </activity>
    <activity android:name="com.example.contactpicker.ContactPickerTester"
              android:label="@string/title_activity_contact_picker_tester" >     
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER"  />
            </intent-filter>
        </activity>
    </application>

</manifest>