小编fre*_*k13的帖子

Android - Apache Mime和httpClient

我正在尝试使用HttpEntity将文件发送到服务器

HttpEntity mpEntity = MultipartEntityBuilder.create().addBinaryBody("file", file, ContentType.create("image/jpeg"), file.getName()).build();

但是为了使用它,我需要将mime库导入到我的项目中.在我的gradle.build中,我添加:

    compile 'org.apache.httpcomponents:httpmime:4.3.4'
Run Code Online (Sandbox Code Playgroud)

我收到以下错误警告,导致库未导入:

WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.4 is ignored for debug as it may be conflicting with the internal version provided by Android.
     In case of problem, please repackage it with jarjar to change the class packages
Run Code Online (Sandbox Code Playgroud)

任何想法我需要做什么,所以我可以成功导入这些库?

java apache android http

8
推荐指数
1
解决办法
2411
查看次数

标签 统计

android ×1

apache ×1

http ×1

java ×1