Duplicate value for resource 'attr/strokeWidth' with config

Faced the same issue, mine was attr/shape in config file, the issue is basically related to conflict of libraries that are using android default libraries, please paste the complete issue also update any thirdparty libraries you are using and it will work. I update one of the libraries and the issue is resolved. as i was using old version of com.facebook.shimmer and i just updated it in gradle and it worked.


This happened to me because I had the following attribute definition that conflicted with the new strokeWidth in the android support library:

 <declare-styleable name="CountdownView">
     <attr name="widgetHeight" format="dimension" />
     <attr name="widgetWidth" format="dimension" />
     <attr name="animationDurationMs" format="integer" />
     <attr name="animationRepeatCount" format="integer" />
     <!-- strokeWidth was the conflict -->
     <attr name="strokeWidth" format="integer" />
     <attr name="paintTextSize" format="dimension" />
 </declare-styleable>

The support library used format="dimension" while I was using format="integer". Changing to format="dimension" solved the problem, and was the correct format anyway:

 <declare-styleable name="CountdownView">
     <attr name="widgetHeight" format="dimension" />
     <attr name="widgetWidth" format="dimension" />
     <attr name="animationDurationMs" format="integer" />
     <attr name="animationRepeatCount" format="integer" />
     <!-- strokeWidth now matches support library -->
     <attr name="strokeWidth" format="dimension" />
     <attr name="paintTextSize" format="dimension" />
 </declare-styleable>

Tags:

Java

Android