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

shellybeyer
shellybeyer
505 Points

Error: Found Item Style/AppTheme More than one time

I have an error after editing the Theme on the Fun Facts Project, that I cannot undo.

I have tried to Clean and Rebuild and undo the edits I made in the training. Nothing is working. I also re downloaded the Zip Project Files. How can I I get back to correct code?

Error:Execution failed for task ':app:mergeDebugResources'.

C:\Users\AndroidStudioProjects\FunFacts\app\src\main\res\values\styles.xml: Error: Found item Style/AppTheme more than one time

resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->

</style>

   <!-- Base application theme. -->
    <style name="AppTheme" parent="android:Theme.Holo.Dialog.NoActionBar">
        <!-- Customize your theme here. -->

    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="Base.ThemeOverlay.AppCompat.Light" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>
Warren Pett
Warren Pett
1,612 Points

Apologies for my ignorance as I haven't done this project but I'm just curious, it says it found item Style/AppTheme more than once, isn't that your problem? you have something called:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <!-- Customize your theme here. -->

You have this twice with different parents but the same name.