错误:元素必须是<manifest>根元素</manifest>的直接子元素

时间:2015-03-23 09:06:23

标签: android manifest

我有以下清单文件,无法弄清楚结束括号有什么问题。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.listensmsmms"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="21" />
 <uses-permission android:name="android.permission.SEND_SMS"></uses-permission>  
 <uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>  
 <uses-permission android:name="android.permission.WRITE_SMS"></uses-permission>  
 <uses-permission android:name="android.permission.READ_SMS"></uses-permission>  

 <uses-permission android:name="android.permission.RECEIVE_MMS"></uses-permission>  

 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"> 

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
   <activity android:label="@string/app_name" android:name=".MainActivity">  
        <intent-filter>  
            <action android:name="android.intent.action.MAIN">  
            <category android:name="android.intent.category.LAUNCHER">  
        </category></action></intent-filter>  
    </activity>  

    <service android:enabled="true" android:name=".ListenSmsMmsService">    
    <intent-filter>    
        <action android:name="com.example.listensmsmms.ListenSmsMmsService">    
        </action>    
    </intent-filter>  
   </service> 
    </application>

  </uses-permission></manifest>

错误位于应用程序标记部分。提前致谢

1 个答案:

答案 0 :(得分:2)

你应该关闭

 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> 

并删除

</uses-permission> // from at last