복붙노트

[SPRING] Android Gradle APK META-INF에 복사 된 중복 파일

SPRING

Android Gradle APK META-INF에 복사 된 중복 파일

내 안드로이드 응용 프로그램에서 봄을 추가하려고하지만 응용 프로그램이 실행되지 않습니다. 나는 왜 나의 실패가 실패했는지 정말로 모른다. 이 문제를 해결하고 도움을 주실 수 있도록 도와 주시겠습니까?

이것은 내 app / build.gradle 설정입니다.

apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.nizar.abdelhedi.accesscontrol"
    minSdkVersion 16
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        resValue "string", "host_name", "access-control-web/rest/roles/attendance"

    }
}
   configurations {
    all*.exclude module: 'httpclient'
    all*.exclude module: 'commons-logging'
}
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'
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.github.vajro:MaterialDesignLibrary:1.6'
    compile 'com.github.blackfizz:eazegraph:1.2.2@aar'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.github.lecho:hellocharts-library:1.5.8@aar'
    compile 'org.springframework:spring-context:4.2.7.RELEASE'
}
}

이것이 내 오류 메시지이다.

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2340Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:app:prepareComGithubBlackfizzEazegraph122Library UP-TO-DATE
:app:prepareComGithubLechoHellochartsLibrary158Library UP-TO-DATE
:app:prepareComGithubVajroMaterialDesignLibrary16Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug UP-TO-DATE
:app:transformClassesWithInstantRunVerifierForDebug UP-TO-DATE
:app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug FAILED
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/spring.schemas
    File1: C:\Users\abdelhedi\.gradle\caches\modules-2\files-2.1\org.springframework\spring-context\4.2.7.RELEASE\289f2906943827d37de89240dbac8fe4b315a838\spring-context-4.2.7.RELEASE.jar
    File2: C:\Users\abdelhedi\.gradle\caches\modules-2\files-2.1\org.springframework\spring-aop\4.2.7.RELEASE\bd65f97ba61fd3dcc0b74765d3fa388aeb388aa7\spring-aop-4.2.7.RELEASE.jar
    File3: C:\Users\abdelhedi\.gradle\caches\modules-2\files-2.1\org.springframework\spring-beans\4.2.7.RELEASE\ae0501728c0ee072e25cb5e11b63b883c0786b4b\spring-beans-4.2.7.RELEASE.jar
Information:BUILD FAILED
Information:Total time: 2.634 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

해결법

  1. ==============================

    1.귀하의 packagingOptions에 다른 것을 추가하십시오

    귀하의 packagingOptions에 다른 것을 추가하십시오

    exclude 'META-INF/spring.schemas'
    

    편집 : keeeeep 그것을 추가! 당신이 중복 된 보트를 가지고있는 것처럼 보입니다.

    예외 : APK BLAH / blah.blah에 복사 된 중복 파일이 표시 될 때마다

    다른 제외 항목 'BLAH / blah.blah'추가

  2. from https://stackoverflow.com/questions/38809286/android-gradle-duplicate-files-copied-in-apk-meta-inf by cc-by-sa and MIT license