I really do now know why I got this error
and how can I solve it.
Actually I am not sure What I did right before I got this error
.
Error Msg: /Users/hyun/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.0.1.arr/25699caf34fef6313d6ec32013a1a117f/res/values/values.xml error:duplicate value for resource 'attr/font' with config". error: resource previously defined here
/Users/hyun/Desktop/Laftel-Android/app/build/intermediates/incremental/mergeDbugResources/merged.dir/values/values.xml duplicate value for resource 'attr/font' with config ". resource previously defined here.
Java.util.concurrent.ExecutionException:com.android.tools.appt2.Aapt2Exception:AAPT2 error: check for details Execution failed for task ':app::mergeDebugResources'. Error: java.utilconcurrentExcutionException:com.android.tools.aapt2.Aapt2Exception : AAPT2 error: check logs for details
It may the concept that makes conflicts with the logic that we have previously used for apply Custom fonts.
Previously
We have used below code for creating the custom attribute for the font.
<declare-styleable name="CustomFont">
<attr name="font" format="string" />
</declare-styleable>
What I change
In my case, this was the issue and I have resolved it by renaming the attr name
<declare-styleable name="CustomFont">
<attr name="fontName" format="string" />
</declare-styleable>
This same thing may apply if you are using any third party library or Custom View with "font" property
As per suggestion by reverie_ss Please Check your res->values->attrs.xml
support library 26 added font attribute to XML elements like TextView, etc. In my case, I was using a library with custom views and a custom attribute app:font
, so they collided. After renaming the library attribute to something else (textFont), all went good again. So, are you using a custom 'font' attribute somewhere? Did you update Gradle to supportLibrary 26 or 27 recently? If you can't override the attribute name, try rolling back to 25
After migrating to AndroidX my error message was
error: duplicate value for resource 'attr/progress' with config ''
and I had a custom attribute defined for a custom view as the following:
<declare-styleable name="ProductionProgressItemView">
<attr name="progressTitle" format="string"/>
<attr name="progress" format="string"/>
<attr name="progressPercent" format="integer"/>
</declare-styleable>
renaming progress to progressValue
fixed the issue.
i updated my android-X libraries to newer versions and i got this type of error in styles.xml
error: duplicate value for resource 'attr/progress' with config ''
this was my previous code there
<declare-styleable name="CircleProgressBar">
<attr name="min" format="integer" />
<attr name="max" format="integer" />
<attr name="progress" format="integer" />
<attr name="progressbarColor" format="color" />
<attr name="progressBarThickness" format="dimension" />
</declare-styleable>
i changed the progress
attribute value by refactoring it to progressValue
like below.
<declare-styleable name="CircleProgressBar">
<attr name="min" format="integer" />
<attr name="max" format="integer" />
<attr name="progressValue" format="integer" />
<attr name="progressbarColor" format="color" />
<attr name="progressBarThickness" format="dimension" />
</declare-styleable>
and it worked for me.
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