Android same attribute name in two libs, name collision

1k views Asked by At

I'm using two 3rd party libs, both use the same attribute name in their attrs.xml. The build fails with:

Attribute "tabBackground" has already been defined

Is there a way to work around this collision without modifying the argument name in one of the libs?

1

There are 1 answers

0
Sergey Shustikov On BEST ANSWER

Actually no.

I suppose you have a dependency from A project to B.

When you build your main project in Eclipse, the resources will fail to build and an error is printed out in the Android console: "... error: Attribute "icon" has already been defined".

Actually you have two ways :

  • remove dependency from A project to B
  • OR change attribute name of some project

Also if you build project with Gradle you can use this article which explains how to merge resources.