Question

I'm developing an application that uses the popular HoloEverywhere library to use ActionBarCompat and get Holo visual style in pre-3.0 devices. It is working perfectly fine.

Now I need to integrate a third-party library project in my application but I'm facing a big issue. This library is using the v7 AppCompat library to use ActionBarCompat in its activities and this is causing lots of errors in my application.

HoloEverywhere includes a custom ActionBarCompat (afaik they took Google's ActionBarCompat and made modifications) and this is in conflict with the ActionBarCompat used in the third-party library I want to integrate. I'm having problems with redeclared styles (as the same styles are declared in the v7 AppCompat and HoloEverywhere), redeclared classes (same case as before), and I cannot come up with any solutions.

Any ideas or should I give up?

Was it helpful?

Solution

Option 1:

You can try and swap the AppCompat used by the HoloEverywhere for the AppCompat used in the other third party library.

Roughly entails:

1) Getting the source for both libaries, and the modified appCompat, pulling it all into eclipse.

2) Once in eclipse swap your modified app compat Jar into the other third parties build path and modify the dependencies etc...for the one they're using, get rid of normal app compat.

3) resolve the entire mess of conflicts which could occur.

Issues:

1) You don't know what weird things they might have done even lower down than AppCompat. Their modified AppCompat might depend on something else entirely which you don't know about.

2) There could be an aweful hell of a time resolving all the errors.

3) It could take a good deal of time to accomplish, and might not be worth the effort.

4) You'll need to be comfortable with dependency management.

Option 2:

Build your project using maven or some other external build manager which allows you to exclude sections of libraries. I know in the past I've had to exclude portions of dependency trees from libraries which relied on differing versions deep in their hierarchy, and you MIGHT (this is a big MAYBE) be able to finesse this out using that sort of mechanism.

This is totally do-able, but could be a pita depending on exactly what was done by who where and when and how and...blah blah.

The other option is to decide which library is more important over all. Is Holo Everywhere really needed? Or can you satisfy that user base with some alternative UI? Is this other third party library actually nescesary? Can you solve that problem some other way?

Finally - while it's not a terrible thing, and it's not something I would say you should never do, this issue is something that you're likely to run into again if you use a modified AppCompat or any other forked library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top