how to resolve this errors ? i can not run it so i dont know?

52 views Asked by At

i want to resolve my mistake pls help me

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@Color/ColorPrimary</item>

        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@Color/ColorAccent</item>

    </style>         

android say: Error:(9, 34) No resource found that matches the given name (at 'colorAccent' with value '@Color/ColorAccent').

3

There are 3 answers

0
Soumya On

Check where the name id present in colors.xml and with the proper case sensitivity and spelling as the one which you mentioned in the style file.

0
Francis Nduba Numbi On

Xml cannot allow capitalization. So the file name should be color and not Color Be careful with cases. Attributes are like variables, start with small letters.

Show us your colors.xml

0
shima ma On
<resources>

    <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/ColorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/ColorAccent</item>
    </style>
<style name="Button_style" parent="@android:style/Widget.Button">
    <item name="android:textSize">25sp</item>
        <item name="android:background">#ffffad2f</item>
        <item name="android:textColor">#fff</item>
        <item name="android:textStyle">bold</item>
    </style>
</resources>

ok,i did so what is the problem again ?