Trying to use the new Design Support Library in my project, AAPT throws the following error:
Description: Error: No resource found that matches the given name: attr 'backgroundTint'.
Resource: /design/res/values/styles.xml
Location: line 21
This is the affected entry in styles.xml
:
<style name="Widget.Design.FloatingActionButton" parent="android:Widget">
<item name="android:background">@drawable/fab_background</item>
<item name="backgroundTint">?attr/colorAccent</item>
<item name="fabSize">normal</item>
<item name="elevation">@dimen/fab_elevation</item>
<item name="pressedTranslationZ">@dimen/fab_translation_z_pressed</item>
<item name="rippleColor">?attr/colorControlHighlight</item>
<item name="borderWidth">@dimen/fab_border_width</item>
</style>
I'm targeting my project to use SDK 21, with min SDK set to 17.
Edit: I have all SDK tools up to date.
Add appcompat-v7 library as dependency to the design library project. It resolve the same error for me. I think it helps you.
I was able to fix the issue with @igece solution, but later I found out that the real issue is an outdated appcompat-v7 library
.
After upgrading it to the latest version nothing had to be edited on Google's libraries.
Seems to be solved adding the format
attribute to both backgroundTint
and backgroundTintMode
items in /res/values/attrs.xml
:
Before:
<declare-styleable name="FloatingActionButton">
<!-- Background for the FloatingActionButton -->
<attr name="android:background"/>
<attr name="backgroundTint"/>
<attr name="backgroundTintMode"/>
After:
<declare-styleable name="FloatingActionButton">
<!-- Background for the FloatingActionButton -->
<attr name="android:background"/>
<attr name="backgroundTint" format="color"/>
<attr name="backgroundTintMode" format="integer"/>
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