0
在我的Android 我對上傳文件到後端服務器,並使用使用MultipartEntityHTTP POST請求做這件事的想法。在這種情況下,我首先添加httpcore和httpmime庫,它給了我一個錯誤。所以一些谷歌搜索後,我發現httpclient-android也必須導入。所以最後我的build.gradle文件如下所示。的Android的HttpCore,httpmime和HttpClient的-的Android庫導入GIVS錯誤
android {
compileSdkVersion 'Google Inc.:Google APIs:21'
buildToolsVersion '23.0.2'
defaultConfig {
applicationId "com.m.l"
minSdkVersion 14
targetSdkVersion 19
versionCode 69
versionName '2.0.15'
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
dependencies {
compile project(':holoColorPickermaster')
compile project(':qRCodeReaderViewlib')
compile project(':volley')
compile project(':library')
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:multidex:'
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpclient-android:4.3.5'
}
但現在當我運行它促使我用不同的error.my錯誤日誌中的應用程序是如下,
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/concurrent/BasicFuture.class
我尋找這個錯誤在網絡和並嘗試修復它。但沒有得到妥善解決。發現這是由文件引起的複製。我怎樣才能解決這個問題。感謝致敬。
感謝您的快速回復。在我的情況下,它說錯誤中的「重複條目:org/apache/http/concurrent/BasicFuture.class」。我怎麼才能找到哪些屬於圖書館的排除??????? –