Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build an Interactive Story App (Retired) User Input Introducing ImageViews

Why do i get an error on my androidmanifest.xml when i haven't edited anything in it?...it shows this error when i run

when i try to run the program, it shows error saying "attribute android:allowBackup is not allowed here, attribute android:icon is not allowed here, attribute android:theme is not allowed here"

similarily with the android version code and android version name... anyone? i want to move forward in this session...quick help please.

2 Answers

Can you post the androidmanifest.xml ? There could be an error in there.

i did exactly as the video said, no reason for anything to disturb in the manifest.xml...

I think somewhere in the manifest, something is not correctly closed off like </example>

Or not correctly placed.

<application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" > //Note the closing here
        <activity

The entire and final manifest.xml layout should look like this, although it might differ on a few places:

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

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

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".ui.StoryActivity"
            android:label="@string/title_activity_story"
            android:parentActivityName=".ui.MainActivity"
            android:screenOrientation="portrait">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".ui.MainActivity" />
        </activity>
    </application>

</manifest>

its looks exactly like that, and if i still get an error then? it says allowBackup, theme and icon are not allowed here...