How to use library with different version then one bundled with Android?

a 夏天 提交于 2020-03-03 09:27:11

问题


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?


回答1:


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/



来源:https://stackoverflow.com/questions/5061987/how-to-use-library-with-different-version-then-one-bundled-with-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!