Android libraries not found Android libraries not found android android

Android libraries not found


Add these two dependency

compile "org.apache.httpcomponents:httpcore:4.2.4"compile "org.apache.httpcomponents:httpmime:4.3"

It will work.


Download the jars from the apache commons site and add them to project and path.

[Edit] now in Apache HttpComponents http://hc.apache.org/downloads.cgi


I know this is an old thread but it make be worth mentioning that these jars are now included in the eclipse Android ADT bundle (for MAC anyway, I have not checked for Windows). You do need to check the version is the one you want, but if it is you are good to go.

This means you can add them to your project without having to download them separately first - just follow these steps:

First right click your project and select properties as shown below:

enter image description here

Then select Java Build Path from the pop up window:

enter image description here

and now select the 'Libraries' tab:

enter image description here

and click on 'Add external JARS' and navigate to your ADT bundle/sdk/tools/lib/httpclient (httpmime etc), and then just click open:

enter image description here

You also need to import the Jar file itself into your project. I found the best way to do this was to simply copy the JAR files into the 'libs' folder in your project - i.e. CTRL C and CTRL V, or normal drag and drop file copy. To be safe I would refresh (right click project and select refresh - see menu in first picture above) and then clean your project.

Note if you do the Build Path part above correctly but forget to add the JAR files themselves into your 'libs' folder, you will get an error like: 'Caused by: java.lang.NoClassDefFoundError: org.apache.http.entity.mime.content.FileBody'.

To resolve this just copy the jar files into the 'libs' folder in your project.

You should now be good to go!