user3259945
user3259945

Reputation: 11

I got ,The markup in the document following the root element must be well-formed. styles.xml, on auto generated code

I am learning Android Development and got this error in AndroidMainfest.xml

The markup in the document following the root element must be well-formed. styles.xml

The codes below is generated automatically.

Original

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

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

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.incomeexp.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>     
</application>
</manifest>

Added

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

<application>
    <activity android:name=".DisplayMessageActivity"
        android:label="@string/title_activity_display_message"
        android:parentActivityName="com.example.incomeexp.MainActivity">
        <meta-data android:name="android.support.PARENT_ACTIVITY"
            android:value="com.example.incomeexp.MainActivity" />
    </activity>
</application>

</manifest> 

Upvotes: 1

Views: 325

Answers (1)

Raghunandan
Raghunandan

Reputation: 133560

Remove the one added. Have the below . Check your package name in manifest and activities. Clean and build

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

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="com.example.incomeexp.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=".DisplayMessageActivity"
        android:label="@string/title_activity_display_message"
        android:parentActivityName="com.example.incomeexp.MainActivity">
        <meta-data android:name="android.support.PARENT_ACTIVITY"
            android:value="com.example.incomeexp.MainActivity" />
    </activity>
</application>
</manifest>

Upvotes: 1

Related Questions