eestein
eestein

Reputation: 5114

How to fix "No resource identifier found for attribute ‘style’ in package ‘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?

Upvotes: 6

Views: 3954

Answers (1)

eestein
eestein

Reputation: 5114

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"

Upvotes: 12

Related Questions