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>
Author by
Nawrez
“Programs must be written for people to read, and only incidentally for machines to execute.”
Updated on July 29, 2022Comments
-
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
-
IntelliJ Amiya over 6 yearsLooks like perfect answer.
-
dhesse over 6 yearsaccording 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 about 5 years@dhesse remove what ? can you explain? i have same issue