AndroidManifest.xml:元素类型"应用程序"必须由匹配的结束标记终止""

时间:2014-09-03 12:57:44

标签: android xml android-manifest manifest

我正在尝试运行我的Android应用,但我收到以下错误

  

资源路径位置类型解析器异常   /TheDatingNetwork/AndroidManifest.xml:元素类型“application”   必须由匹配的结束标记“”终止。   TheDatingNetwork第1行Android ADT问题

有人可以给我写'正确'的版本吗?感谢。

这是我的清单文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.creativedigitals.easywebapp"
    android:installLocation="preferExternal"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="20" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
    <uses-feature android:name="android.hardware.camera" android:required="false"/> 
    <uses-permission android:name="android.permission.CAMERA" android:required="false"/> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION"/>

    <application
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
        <activity
            android:name="com.creativedigitals.easywebapp.Splashscreen"
            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="com.creativedigitals.easywebapp.MainActivity"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:windowSoftInputMode="adjustPan"
            android:configChanges="orientation|keyboardHidden|screenSize" >
        </activity>
        <activity
            android:name="com.creativedigitals.easywebapp.Image"
            android:label="@string/title_activity_image" >
        </activity>
       </activity>
    </application>
</manifest>

4 个答案:

答案 0 :(得分:1)

最后有一个</activity>

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.creativedigitals.easywebapp"
      android:installLocation="preferExternal"
      android:versionCode="1"
      android:versionName="1.0" >

<uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="20" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-permission android:name="android.permission.CAMERA" android:required="false"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION"/>

<application
        android:allowBackup="true"
        android:hardwareAccelerated="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
    <activity
            android:name="com.creativedigitals.easywebapp.Splashscreen"
            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="com.creativedigitals.easywebapp.MainActivity"
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:windowSoftInputMode="adjustPan"
            android:configChanges="orientation|keyboardHidden|screenSize" >
    </activity>
    <activity
            android:name="com.creativedigitals.easywebapp.Image"
            android:label="@string/title_activity_image" >
    </activity>

        

答案 1 :(得分:0)

</activity>之前您的</application>标记不匹配。

答案 2 :(得分:0)

查看评论

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="20" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" />
<uses-feature android:name="android.hardware.camera" android:required="false"/> 
<uses-permission android:name="android.permission.CAMERA" android:required="false"/> 
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION"/>

<application
    android:allowBackup="true"
    android:hardwareAccelerated="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
    <activity
        android:name="com.creativedigitals.easywebapp.Splashscreen"
        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="com.creativedigitals.easywebapp.MainActivity"
        android:label="@string/app_name"
        android:launchMode="singleInstance"
        android:windowSoftInputMode="adjustPan"
        android:configChanges="orientation|keyboardHidden|screenSize" >
    </activity>
    <activity
        android:name="com.creativedigitals.easywebapp.Image"
        android:label="@string/title_activity_image" >
    </activity>
   </activity>//remove this extra closing tag 
</application>

答案 3 :(得分:0)

您已插入额外的</activity>,在</activity>代码之前移除</application>