Thomas k
Thomas k

Reputation: 129

Error: No resource found that matches the given name: attr 'colorAccent' in Eclipse

I am amateur to android development and I have been working on a project on eclipse. I am already done my android:minSdkVersion="21" and android:targetSdkVersion="22" and project build target on API on 21. Following are the error in my style.xml

[2016-03-05 15:55:13 - Iot] C:\workspace\Iot\res\values\style1.xml:12: error: Error: No resource found that matches the given name: attr 'colorAccent'.

[2016-03-05 15:55:13 - Iot] [2016-03-05 15:55:13 - Iot] C:\workspace\Iot\res\values\style1.xml:10: error: Error: No resource found that matches the given name: attr 'colorPrimary'.

[2016-03-05 15:55:13 - Iot] [2016-03-05 15:55:13 - Iot] C:\workspace\Iot\res\values\style1.xml:11: error: Error: No resource found that matches the given name: attr 'colorPrimaryDark'.

[2016-03-05 15:55:13 - Iot] [2016-03-05 15:55:13 - Iot] C:\workspace\Iot\res\values\style1.xml:8: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.

Here is the xml code of style.xml

<resources>

    <style name="MyMaterialTheme" parent="MyMaterialTheme.Base">

    </style>

    <style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

</resources>

I am bit confused with what to be done and I would be glad if anyone could help me with the issue. Thanks in advance.

Upvotes: 0

Views: 2419

Answers (1)

Avijit Karmakar
Avijit Karmakar

Reputation: 9388

Use those attributes as:

<resources>
    <style name="MyMaterialTheme" parent="MyMaterialTheme.Base" />

    <style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
        <item name="android:colorPrimary">@color/colorPrimary</item>
        <item name="android:colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="android:colorAccent">@color/colorAccent</item>
    </style>

</resources>

Upvotes: 0

Related Questions