Android MultipartEntityBuilder需要httpcore,但这会导致与内部版本冲突。有办法吗?

Android MultipartEntityBuilder需要httpcore,但这会导致与内部版本冲突。有办法吗?,android,multipartentity,Android,Multipartentity,我正在开发一个需要使用MultipartEntityBuilder的应用程序。 为了使用它,我加入了org.apache.httpcomponents:httpmime:4.4 以下是应用程序中的代码片段: MultipartEntityBuilder builder = MultipartEntityBuilder.create(); builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); builder.a

我正在开发一个需要使用MultipartEntityBuilder的应用程序。 为了使用它,我加入了org.apache.httpcomponents:httpmime:4.4

以下是应用程序中的代码片段:

MultipartEntityBuilder builder = MultipartEntityBuilder.create();
        builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
        builder.addPart("file", new FileBody(new File(filePath)));
        builder.addTextBody("type", type);
        builder.addTextBody("phone", pPhoneNumber);
现在的问题是,这里的FileBody需要ContentType类,该类包含在org.apache.httpcomponents:httpcore中。但如果我在Gradle中导入这个,我将无法继续编译,因为它与Android提供的内部版本冲突。我遇到以下错误:

Error:duplicate files during packaging of APK /somepath/app/build/outputs/apk/app-debug-unaligned.apk
Path in archive: META-INF/DEPENDENCIES
    Origin 1: /Users/Sachin/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpmime/4.4/54646f004d5b4c37a5a75b1d416c59a3075204e2/httpmime-4.4.jar
    Origin 2: /Users/Sachin/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.4.1/f5aa318bda4c6c8d688c9d00b90681dcd82ce636/httpcore-4.4.1.jar
请提出解决办法