所以我试图生成在Android Studio中创建的Android项目的APK文件,我不断收到以下错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/concurrent/Cancellable.class
这里也是我的build.gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.app"
minSdkVersion 18
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile project(':vitamio')
compile 'com.android.support:appcompat-v7:24.0.0-beta1'
compile 'com.google.android.gms:play-services:9.0.1'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.android.support:design:24.0.0-beta1'
compile 'com.github.natasam:DemoProgressViewsLibApp:fa2f8f01e0'
compile 'com.google.android.gms:play-services-ads:9.0.1'
compile 'com.google.android.gms:play-services-auth:9.0.1'
compile 'com.google.android.gms:play-services-gcm:9.0.1'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile group: 'cz.msebera.android' , name: 'httpclient', version: '4.4.1.1'
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile 'com.android.support:multidex:1.0.0'
compile 'com.google.android.gms:play-services-maps:8.3.0'
}
那么任何人都可以告诉我如何解决这个错误?我尝试删除依赖项中的http,但仍然出错。任何回应都是适当的。谢谢!