【问题标题】:Android Manifest . The markup in the document following the root element must be well formed安卓清单。文档中根元素之后的标记必须格式正确
【发布时间】:2014-08-16 07:22:36
【问题描述】:

我查看了有关同一问题的其他问题,但无法找到有用的解决方案。这是我的 xml 。它有什么问题?

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

<uses-sdk
    android:minSdkVersion="15"
    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=".LogInActivity"
        android:label="@string/title_activity_log_in"
        android:parentActivityName="com.example.projextxy" >
    </activity>
    <activity
        android:name=".SignUpActivity"
        android:parentActivityName="com.example.projextxy"
        android:label="@string/title_activity_sign_up" >
    </activity>
</application>

【问题讨论】:

    标签: android xml eclipse


    【解决方案1】:

    您错过了应用程序标记后的最后一个清单标记&lt;/manifest&gt;

        <?xml version="1.0" encoding="utf-8"?>
        <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.projextxy"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk
            android:minSdkVersion="15"
            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=".LogInActivity"
                android:label="@string/title_activity_log_in"
                android:parentActivityName="com.example.projextxy" >
            </activity>
            <activity
                android:name=".SignUpActivity"
                android:parentActivityName="com.example.projextxy"
                android:label="@string/title_activity_sign_up" >
            </activity>
        </application>
    </manifest>
    

    【讨论】:

    • 我添加了 标签,但仍然出现错误。
    • 我复制并粘贴了您给我的代码。现在出现一个新错误“XML 文档结构必须以相同的实体开始和结束”。
    • 只需检查一次所有标签。让您也关闭所有标签(xml 标签除外)。在我看来,其他一切都很好。
    • 查看了所有内容并仔细检查了除 xml 之外的所有标签都已关闭。仍然没有结果。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多