我将Android eclipse项目迁移到Android Studio项目,但是当我尝试运行我的应用程序时,它会标记以下错误 -
Error:Execution failed for task ':wikiNews:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/apache/http/MessageConstraintException.class
以下是我的build.gradle文件 -
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "com.abc.wikiNews"
minSdkVersion 15
targetSdkVersion 23
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':easyAndroidAnimationsLibrary')
compile project(':liveSdk')
compile project(':main')
compile project(':zbarSample')
compile project(':stickyHeaderLibrary')
compile project(':starBar')
compile project(':facebookSDK')
compile project(':library')
compile project(':ffmpeg4android_lib')
compile project(':socialNetworkingLib')
/*compile 'com.google.android.gms:play-services:+'*/
compile 'com.google.android.gms:play-services:9.6.1'
/*compile 'com.android.support:appcompat-v7:23.4.0'*/
/* compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:support-v4:22.0.0'*/
compile files('libs/nmdp_speech_kit.jar')
compile files('libs/AndroidSwipeLayout-v1.1.8.jar')
compile files('libs/commons-logging-1.2.jar')
compile files('libs/CWAC-SackOfViewsAdapter.jar')
compile files('libs/devsmartandroid.jar')
compile files('libs/google-api-client-1.6.0-beta.jar')
compile files('libs/google-api-services-plus-v1-1.3.0-beta.jar')
// compile files('libs/google-oauth-client-1.6.0-beta.jar')
compile files('libs/httpclient-4.4.jar')
compile files('libs/httpcore-4.4.jar')
// compile files('libs/thttpmime-4.3.5.jar')
compile files('libs/picasso-2.4.0.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/signpost-jetty6-1.2.1.2.jar')
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile('org.apache.httpcomponents:httpmime:4.3')
{
exclude module: "httpclient"
}
}
如果我能提供更多信息,请告诉我。谢谢。
答案 0 :(得分:0)
删除gradle文件中的这些依赖项:
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
并将此依赖项添加到您的gradle文件中:
compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'