Android libraries not found

2020-02-04 07:35发布

In my android project I am writing a program to connect to a server and below are the libraries that I need to use.

But I get an error saying the following cannot be resolved. How to resolve this error? I am using eclipse JAVA EE on Windows.

 import org.apache.http.entity.mime.MultipartEntity;
 import org.apache.http.entity.mime.content.ContentBody;
 import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.entity.mime.content.StringBody;

8条回答
时光不老,我们不散
2楼-- · 2020-02-04 08:24

Add these two dependency

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

It will work.

查看更多
不美不萌又怎样
3楼-- · 2020-02-04 08:35

download the jar from here : http://commons.apache.org/

install it in your project like this:

Right click on your project and go to properties. On the left tab go to "java build path". And in that on right go to libraries. Click on add external jars and give the path of the jar and your library is added.

查看更多
登录 后发表回答