fhucho
fhucho

Reputation: 34550

Android same attribute name in two libs, name collision

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?

Upvotes: 6

Views: 1064

Answers (1)

Sergey Shustikov
Sergey Shustikov

Reputation: 15821

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.

Upvotes: 4

Related Questions