2016-12-07 5 views
0

내 응용 프로그램에 문제가 있습니다! build.gradle 동기화 및 오류없이,하지만 내가 응용 프로그램 오류를 실행하려면!오류 : 실행 ': 찾기 : transformResourcesWithMergeJavaResForDebug'에 대한 실행이 실패했습니다.

Error:Execution failed for task ':Find Me:transformResourcesWithMergeJavaResForDebug'.

com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE File1: C:\Users****\workspace\Find Me\libs\httpclient-4.5.1.jar

File2: C:\Users****\workspace\Find Me\libs\httpclient-cache-4.5.1.jar

File3: C:\Users****\workspace\Find Me\libs\httpclient-win-4.5.1.jar

File4: C:\Users****\workspace\Find Me\libs\httpcore-4.4.3.jar

와 build.gradle :

apply plugin: 'com.android.application' 

dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    compile project(':android-support-v7-appcompat') 
    compile project(':CircularImageView') 
    compile project(':FacebookSDK') 
    compile project(':google-play-services_lib') 
    compile project(':google-play-services_lib') 
    compile project(':FacebookSDK') 
    compile project(':android-support-v7-appcompat') 
    compile project(':CircularImageView') 
} 

android { 
    compileSdkVersion 23 
    buildToolsVersion "25.0.1" 

    sourceSets { 
     main { 
      manifest.srcFile 'AndroidManifest.xml' 
      java.srcDirs = ['src'] 
      resources.srcDirs = ['src'] 
      aidl.srcDirs = ['src'] 
      renderscript.srcDirs = ['src'] 
      res.srcDirs = ['res'] 
      assets.srcDirs = ['assets'] 
     } 

     // Move the tests to tests/java, tests/res, etc... 
     instrumentTest.setRoot('tests') 

     // Move the build types to build-types/<type> 
     // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... 
     // This moves them out of them default location under src/<type>/... which would 
     // conflict with src/ being used by the main source set. 
     // Adding new build types or product flavors should be accompanied 
     // by a similar customization. 
     debug.setRoot('build-types/debug') 
     release.setRoot('build-types/release') 
    } 
} 

이 grandle 파일에서 당신에게

답변

0

감사 당신이 compile project(':google-play-services_lib') compile project(':google-play-services_lib') compile project(':FacebookSDK') compile project(':android-support-v7-appcompat') compile project(':CircularImageView') 2 회

을 삭제 한 번만 각을 사용하여이 오류가

apply plugin: 'com.android.application' 

dependencies { 
compile fileTree(dir: 'libs', include: '*.jar') 
compile project(':android-support-v7-appcompat') 
compile project(':CircularImageView') 
compile project(':FacebookSDK') 
compile project(':google-play-services_lib') 

} 

android { 
compileSdkVersion 23 
buildToolsVersion "25.0.1" 

sourceSets { 
    main { 
     manifest.srcFile 'AndroidManifest.xml' 
     java.srcDirs = ['src'] 
     resources.srcDirs = ['src'] 
     aidl.srcDirs = ['src'] 
     renderscript.srcDirs = ['src'] 
     res.srcDirs = ['res'] 
     assets.srcDirs = ['assets'] 
    } 

    // Move the tests to tests/java, tests/res, etc... 
    instrumentTest.setRoot('tests') 

    // Move the build types to build-types/<type> 
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ... 
    // This moves them out of them default location under src/<type>/... which would 
    // conflict with src/ being used by the main source set. 
    // Adding new build types or product flavors should be accompanied 
    // by a similar customization. 
    debug.setRoot('build-types/debug') 
    release.setRoot('build-types/release') 
} 
} 

편집 :

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' 
} 
+0

감사합니다 노력하지만, 여전히 같은 오류! – user2003857

+0

@ user2003857 컴파일 프로젝트를 사용하는 이유를 알려주시겠습니까? 이 파일들을 편집하고 있습니까? –

+0

@ user2003857 내 편집 –

0

@VygintasB는 중복 종속성을 제거하고 모듈 레벨 build.gradle 파일이 블록을 추가하려고 말했듯이, 중복 파일을 말하는 오류가 복사 안드로이드 {} 내부에이 줄을 추가 APK META-INF/라이센스에 그래서 그냥 사람들을 제외하고

android { 
//..... 
    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/dependencies.txt' 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     }  

    } 
+0

답변 해 주셔서 감사합니다. 답변 감사합니다. 이 오류가 발생했습니다! 오류 : (2, 0) 프로젝트 'Find Me'에서 org.gradle.api.Project 유형의 [packaging_7m54jl7uaw8y6qoof85j6ic93 $ _run_closure1 @ 41a63d94] 인수에 대해 packagingOptions() 메소드를 찾을 수 없습니다. – user2003857

+0

업데이트 된 gradle 파일 – Raghavendra

+0

@ user2003857을 게시 할 수 있습니까? packagingOptions() 블록을 어디에 두었습니까? 그라데이션 파일 안드로이드 블록을 안에 넣어주세요 – Raghavendra

관련 문제