2014-04-26 119 views
1

我在AndroidManifest.xml文件中看到標題爲「Error」。「解析XML時出錯:XML聲明格式不正確」[android]

錯誤位於</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> 

回答

4

閉上你的清單標籤。添加>

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

derp。謝謝 – user3466400

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> 
相關問題