java.util.zip.ZipException:使用spring框架复制条目 [英] java.util.zip.ZipException: duplicate entry with spring framework

查看:188
本文介绍了java.util.zip.ZipException:使用spring框架复制条目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在android工作室中使用spring框架开发Android应用程序,
我有这个错误

 执行失败的任务':app:packageAllDebugClassesForMultiDex'。 
> java.util.zip.ZipException:重复条目:org / springframework / beans / BeansException.class

I阅读一些问题/答案,但是我没有找到我的问题的解决方案,
示例:
java.util.zip.ZipException:packageAllDebugClassesForMultiDex中的重复条目



我的build.brandle是

  android {
compileSdkVersion 22
buildToolsVersion22.0.1

defaultConfig {
applicationIdcom.example.simone.oauth
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName1.0
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packageOptions {
exclude'META-INF / ASL2.0'
exclude'META-INF / LICENSE'
exclude'META-INF / license.txt'
exclude'META-INF / NOTICE'
exclude'META-INF / notice.txt'
}
}

configured.compile {
exclude module:'spring-core'
exclude module:'spring-web'
exclude module:'commons-logging'

}


依赖关系{
编译fileTree(dir:'libs',include:['* .jar'])
compile com.android.support:appcompat-v7:22.2.0')
compile('org.springframework.android:spring-android-rest-template:1.0.1.RELEASE')
compile'org .springframework.android:spring-android-auth:1.0.1.RELEASE'
compile'org.springframework.security:spring-security-crypto:3.1.3.RELEASE'
compile'org.springframework 。社会:弹簧社会-C onfig:1.1.0.RELEASE'
compile'org.springframework.social:spring-social-core:1.1.2.RELEASE'
compile'org.springframework.social:spring-social-google: $ 1.0 $。$ >

我如何排除这个错误?

解决方案

我几乎有同样的问题使用multidex spring-core我这样解决

  compile('org.springframework.security:spring-security-crypto:3.1。 4.RELEASE')
{
exclude group:'org.springframework',module:'spring-core'
}

所以在你的情况下你必须排除春季豆子


I'm developing android app with spring framework in android studio, i've this error

Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: org/springframework/beans/BeansException.class

I read some questions/answers but i don't find solution for my problems, example: java.util.zip.ZipException: duplicate entry during packageAllDebugClassesForMultiDex

My build.brandle is

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.example.simone.oauth"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/notice.txt'
    }
}

configurations.compile {
    exclude module: 'spring-core'
    exclude module: 'spring-web'
    exclude module: 'commons-logging'

}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile ('com.android.support:appcompat-v7:22.2.0')
    compile ('org.springframework.android:spring-android-rest-template:1.0.1.RELEASE')
    compile 'org.springframework.android:spring-android-auth:1.0.1.RELEASE'
    compile 'org.springframework.security:spring-security-crypto:3.1.3.RELEASE'
    compile 'org.springframework.social:spring-social-config:1.1.0.RELEASE'
    compile 'org.springframework.social:spring-social-core:1.1.2.RELEASE'
    compile 'org.springframework.social:spring-social-google:1.0.0.RELEASE'
    compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.11'
}

How can i exclude this error?

解决方案

I had almost the same problem with multidex spring-core i resolve like this

compile ('org.springframework.security:spring-security-crypto:3.1.4.RELEASE')
        {
            exclude group :'org.springframework', module: 'spring-core'
        }

so in your case you have to exclude spring beans

这篇关于java.util.zip.ZipException:使用spring框架复制条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆