Mike Schreiner
Mike Schreiner

Reputation: 51

Attribute Already Defined When Using HoloEverywhere and UnifiedPreference

I have a project that is currently using ActionBarSherlock, Crouton, and UnifiedPreference which works (compiles, runs without issue on devices and emulator for Android 2.3.3+). I want to add HoloEverywhere so that I can keep a unified interface when it runs on Gingerbread devices. Once I added HoloEverywhere to the mix I get the following AAPT errors:

[2012-12-14 12:47:04 - MyApp] C:\git\myrepo\UnifiedPreference\library\res\values\atrs.xml:7: error: Attribute "id" has already been defined
[2012-12-14 12:47:04 - MyApp] C:\git\myrepo\UnifiedPreference\library\res\values\atrs.xml:11: error: Attribute "summary" has already been defined
[2012-12-14 12:47:04 - MyApp] C:\git\myrepo\UnifiedPreference\library\res\values\atrs.xml:13: error: Attribute "breadCrumbTitle" has already been defined
[2012-12-14 12:47:04 - MyApp] C:\git\myrepo\UnifiedPreference\library\res\values\atrs.xml:15: error: Attribute "breadCrumbShortTitle" has already been defined
[2012-12-14 12:47:04 - MyApp] C:\git\myrepo\UnifiedPreference\library\res\values\atrs.xml:19: error: Attribute "fragment" has already been defined

The AAPT errors reference whichever library project is first (either UnifiedPreference OR HoloEverywhere) in my android library dependency list. I've also discovered that all of the offending attributes are defined as part of <declare-styleable name="PreferenceHeader"> My current Android Dependency order and structure is:

MyApp
   ActionBarSherlock
   HoloEverywhere
   UnifiedPreference
   Crouton
HoloEverywhere
   ActionBarSherlock
UnifiedPreference
   ActionBarSherlock
Crouton

I have tried changing the order of HoloEverywhere and UnifiedPreference, removing ActionBarSherlock from one and making it dependent on the other, and tried pulling them down from git again.

Does anyone know how to get UnifiedPreference and HoloEverywhere to play nicely together since they both have attributes with the same name?

Upvotes: 1

Views: 1971

Answers (1)

LuxuryMode
LuxuryMode

Reputation: 33771

Yeah, you're gonna have to rename some attributes to get rid of that AAPT problem. Once the resources get merged into your project, you can't have attributes with the same name. If in reality these are duplicate attributes (meaning, ones that happened to been defined from scratch in its respective project and actually identical to the other), then simply delete them leave in the highest dependency that contains those and delete them from the lower ones.

Upvotes: 2

Related Questions