1

I want to use the latest HttpClient 4.1 version in my application. But Android already bundled with HttpClient.

The only way that I see is to build this library from sources, and change package name.

Is there any other solution?

EDIT:

At download page I see OSGi bundle. I have no experience in using OSGi, but AFAIK, OSGi intended to solve libraries versioning problems? If so, how can I use it?

alex2k8
  • 42,496
  • 57
  • 170
  • 221

1 Answers1

2

You can use the Maven Shade Plugin to move all classes to a different package and then use it from there. http://maven.apache.org/plugins/maven-shade-plugin/

If you do that the easiest will be to also build you application with Maven using the Maven Android Plugin http://code.google.com/p/maven-android-plugin/

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
  • I haven't been able to get the maven-shade-plugin and the android-maven-plugin (new name of the maven-android-plugin) to properly work together. There is some talk about a related patch for the android-maven-plugin (https://code.google.com/p/maven-android-plugin/issues/detail?id=170), but as far as I can tell this never made into a mainline/released version. Were you able to get it working? And if so, can you provide some sample pom.xml code? Thanks. – Matthias Oct 23 '14 at 09:50
  • I never needed it myself. Worst case you can do the shading of a jar in a separate project and then depend on that shaded jar. This will definitely work. – Manfred Moser Oct 23 '14 at 15:29