0

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.

1 Answer 1

0

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>
1
  • Thanks for the help !! I apologize for bothering with such a small logic.
    – Thomas k
    Mar 5, 2016 at 11:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.