Reputation: 854
I added a library to my project in Android Studio. But as soon as I tried to compile my project I got this error:
Attribute barColor has already been declared.
After that I checked the whole project and noticed that another library is already declaring that same attribute!
How can I fix this conflict or can I just not use those libraries at the same time?
The libraries which are causing the conflict are:
Upvotes: 2
Views: 919
Reputation:
Create a new folder and name it like this values-v21
then put that particular xml file like attr.xml that causing a duplication to that folder. By doing it will not confuse or merge the two identical resources, but of course by doing this you say that this attr will be use only starting from sdk 21 and above depends on what sdk version you will provide.
Upvotes: 1
Reputation: 49817
The easiest fix for this is to just rename the attribute in one of the libraries. To do that you have to:
After that you should be all set. Now that the attributes have different names there shouldn't be any conflict!
Upvotes: 0