2

I have used AppCompat and I updated Android Support Library to 21.0.2 and changed my Project compile with to API 21. after that Eclipse shows an error in themes.xml. and It said:

error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.Base.ActionBar.Solid.Inverse'.

my themes.xml file is like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>

    <style name="HamsaThemeDefaultDark" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="icScheduledDrawable">@drawable/ic_drawer_schedule</item>
        <item name="icExcludedUpdatesDrawable">@drawable/ic_action_cancel</item>
        <item name="icMyAccountDrawable">@drawable/ic_action_accounts</item>
        <item name="icRollbackDrawable">@drawable/ic_action_time</item>
        <item name="homeLabelbackground">@drawable/app_header_bgd_hamsa_dark</item>
        <item name="customRowForegroundHomeLayout">@style/customRowStyleHomeLayout</item>
        <item name="backgroundCard">@style/backgroundCardStyleLight</item>
    </style>

    <style name="HamsaThemeDefaultLight" parent="Theme.AppCompat.Light">
        <item name="icScheduledDrawable">@drawable/ic_drawer_schedule</item>
        <item name="icExcludedUpdatesDrawable">@drawable/ic_action_cancel</item>
        <item name="icMyAccountDrawable">@drawable/ic_action_accounts</item>
        <item name="icRollbackDrawable">@drawable/ic_action_time</item>
        <item name="homeLabelbackground">@drawable/app_header_bgd_hamsa_light</item>
        <item name="customRowForegroundHomeLayout">@style/customRowStyleHomeLayout</item>
        <item name="backgroundCard">@style/backgroundCardStyleLight</item>
    </style>

    <style name="HamsaThemeDefaultLightOverlayActionbar" parent="HamsaThemeDefaultLight">
        <item name="android:windowActionBarOverlay">true</item>

        <!-- Support library compatibility -->
        <item name="windowActionBarOverlay">true</item>
         <item name="android:actionBarStyle">@style/MyActionBar</item>
    </style>
     <style name="MyActionBar" parent="Widget.AppCompat.Light.Base.ActionBar.Solid.Inverse">
        <item name="android:background">@android:color/transparent</item>

    </style> 

    <style name="HamsaThemeDefaultLightNoActionBar" parent="@style/Theme.AppCompat.Light">
        <item name="android:windowNoTitle">true</item>
    </style>

</resources>

what can I do for this problem? I have seen these solutions Error in styles_base.xml file - android app - No resource found that matches the given name 'android:Widget.Material.ActionButton' , appcompat-v721-0-0-no-resource-found-that-matches-the-given-name-attr-andro but I have still the problem.

Community
  • 1
  • 1
Majid Daeinejad
  • 1,037
  • 8
  • 19

1 Answers1

1

Finally I found a solution to solve my problem. Android Support Library for AppCompat version 21 changed some themes' namespaces.

Widget.AppCompat.Light.Base.ActionBar

changes to

Base.Widget.AppCompat.Light.ActionBar

so I changed my themes.xml file to this:

<style name="HamsaThemeDefaultLightOverlayActionbar" parent="HamsaThemeDefaultLight">
    <item name="android:actionBarStyle">@style/MyActionBar</item>
    <item name="android:windowActionBarOverlay">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:elevation">0dp</item>

    <!-- Support library compatibility -->
    <item name="actionBarStyle">@style/MyActionBar</item>
    <item name="windowActionBarOverlay">true</item>
    <item name="elevation">0dp</item>
</style>

<!-- ACTION BAR STYLES -->
<style name="MyActionBar" parent="@style/Base.Widget.AppCompat.Light.ActionBar.Solid">
    <item name="android:background">@android:color/transparent</item>

    <!-- Support library compatibility -->
    <item name="background">@android:color/transparent</item>
</style>

and it works perfectly.

Piovezan
  • 3,215
  • 1
  • 28
  • 45
Majid Daeinejad
  • 1,037
  • 8
  • 19