error: expected color but got (raw string) color/gray

16,693

You forgot to add @ before color/colorPrimary

change it like @color/colorPrimary

sample code

 <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>
Share:
16,693
Nawrez
Author by

Nawrez

“Programs must be written for people to read, and only incidentally for machines to execute.”

Updated on July 29, 2022

Comments

  • Nawrez
    Nawrez over 1 year

    I have switched to android studio 3. after many problem that I fixed, I got this error:

    color/colorPrimary but i go this error:Error:(87, 5) error: expected color but got (raw string) color/gray

    enter image description here

  • IntelliJ Amiya
    IntelliJ Amiya over 6 years
    Looks like perfect answer.
  • dhesse
    dhesse over 6 years
    according to this page developer.android.com/studio/build/… migrating to Android Studio 3 requires to remove them. I guess that's were OP is referring to.
  • Libin Thomas
    Libin Thomas about 5 years
    @dhesse remove what ? can you explain? i have same issue