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?
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With