A safe way to resolve dependency conflicts for Drive and Dropbox?

I would like to integrate my application with various file storage services. I followed the quickstart instructions for the sdk disk, which adds a bunch of jars to my libs project directory. In addition, the following list of banners is required for Dropbox sdk:

  • General Logging 1.1.1.jar
  • transfer-android-SDK-1.5.3.jar
  • HttpClient-4.0.3.jar
  • httpcore-4.0.1.jar
  • httpmime-4.0.3.jar
  • JSON-simple 1.1.jar

As soon as they are all added to my project, I get the following error when trying to run:

Dex Loader] Unable to execute dex: several dex files define Lorg / Apache / HTTP / entity / mime / FormBodyPart;

If I delete the httpmime jar added to Dropbox, my project works fine. But is this a safe way to resolve the conflict? Is there an alternative method by which I can build my project and include all the necessary banks?

+6
source share
2 answers

Assuming no version conflicts this will work fine. Compare httpmime-4.0.3.jar with the httpmime bank that Disk added to your libs directory. If they are the same, then that's fine. If they are different, then you will need to find out the differences between them and insure them against changes. As a last resort, you can also repackage one of the SDKs with the required version of httpmime in the bank, selectively confused with ProGuard, although this is a problem.

0
source

If you work with Eclipse, think about how to use the Google Plugin for Eclipse. This makes it possible to add any of the Google SDKs to your application. All banks are added automatically.

0
source

All Articles