Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "No resource identifier found for attribute ‘style’ in package ‘android’"?

Tags:

android

I created a style and applied it to a button, but when I try to build I get the exception:

No resource identifier found for attribute ‘style’ in package ‘android’

This is the button's code:

<Button
            android:text="Settings"
            android:style="@style/SecondaryButton"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/settingsButton"
            android:layout_weight="0" />

What could be wrong?

like image 327
eestein Avatar asked Mar 08 '17 14:03

eestein


1 Answers

The problem is that the style tag does not need the android package namespace, even though many IDEs will suggest that as correct. So instead of:

android:style="@style/SecondaryButton"

use:

style="@style/SecondaryButton"

like image 197
eestein Avatar answered Oct 25 '22 18:10

eestein