Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 415
fhucho Avatar asked Jun 25 '15 11:06

fhucho


1 Answers

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.

like image 144
Sergey Shustikov Avatar answered Oct 12 '22 06:10

Sergey Shustikov