2016-11-24 1 views
0

나는 모두 스택 오버플로 및 구글 내 질문에 관련된 모든 솔루션을 시도했습니다. 나는 오랫동안이 오류에 질려했다. 나는 단지이오류 해결 방법 : ': app : transformClassesWithJarMergingForDebug'.?

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

    defaultConfig { 
     applicationId "com.inspirenetz.app.inpartner" 
     minSdkVersion 19 
     targetSdkVersion 23 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
     testInstrumentationRunner "com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    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' 
    } 

    testOptions { 
     unitTests.returnDefaultValues = true 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    testCompile 'org.json:json:20140107' 
    compile 'com.android.support:appcompat-v7:23.1.0' 
    compile 'com.android.support:design:23.1.0' 
    compile 'com.android.support:support-v4:23.1.0' 
    compile 'com.github.satyan:sugar:1.4' 
    compile 'com.google.code.gson:gson:2.4' 
    compile 'com.fasterxml.jackson.core:jackson-core:2.4.1' 
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.4.1' 
    compile 'com.fasterxml.jackson.core:jackson-databind:2.4.1' 
    compile group: 'cz.msebera.android' , name: 'httpclient', version: '4.4.1.1' 

    compile 'com.embarkmobile:zxing-android-minimal:[email protected]' 
    compile 'com.embarkmobile:zxing-android-integration:[email protected]' 
    compile 'com.google.zxing:core:3.2.1' 

    // Avoid the 64K limit, Multidex support for Android 5.0 and higher 
    compile 'com.android.support:multidex:1.0.1' 

    compile files('libs/mswiperAPIVer2.0.jar') 

    repositories { mavenCentral() 
     maven { url "https://raw.github.com/embarkmobile/zxing-android-minimal/mvn-repo/maven-repository/" } 
    } 

} 

여기 내 build.gradle입니다 다음과 같은 오류

을 얻고이 lib 디렉토리를 추가시 있도록

는 아래의 Gradle을 파일에 추가됩니다 스캔 QR 코드 lib 디렉토리를 사용하고 오류 도대체 나에게 살해

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. 

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/zxing/aztec/AztecDetectorResult.class

정말 일부 expec 감사시겠습니까 ted 솔루션도 많은 관련 질문을 해결할 것입니다

미리 감사드립니다.

+1

이것은 문제에 대한 답이 아닙니다. 문제가'zxing'에있는 경우, 예를 들어 언제든지 예를 들어. 대신에 'google.vision.barcode'. 그것은 지원 lib에 선적 된 Google 기본 바코드 라이브러리입니다. 아마도 [이 게시물] (https://www.varvet.com/blog/android-qr-code-reader-made-easy/)로 곧바로 QR 리더기를 사용할 수 있습니다! – Algar

+0

오, 오, 내 마지막으로 나는이 질문에 답장을 얻었다. 감사합니다.,하지만이 코드를 사용하고 그 성능에 대해서 알고있을 수도 있습니다. – Raju

+0

실제로 위의 lib도 제게 하나의 프로젝트에서 잘 작동하지만 다른 프로젝트를 추가하려고 할 때 이 오류가 발생했습니다 – Raju

답변

0

마침내 나는 나의 질문 from this post의 해결책을 오래 전에 발견했다. QR/바코드 스캐너 용 lib도 변경되었습니다.

문제점 : 나는 외부 이름을 core.jar으로 사용하고 있습니다. 그래서 AztecDetectorResult.class에는 이미 core.jar이 있고 내 스캐너에는 lib 의존성 core-3.2.1도 있습니다. 그래서 그것은 아래와 같은 중복 입력 오류를 던집니다.

com.android.build.api.transform.TransformException: 
java.util.zip.ZipException: duplicate entry: com/google/zxing/aztec/AztecDetectorResult.class 

솔루션 : 나는 아래와 같은 core.jar를에서 제외했습니다.

configurations{ 
    all*.exclude module: 'core' 
} 

와 나는 효율적인 QR/바코드 스캐너 나의 새로운 LIB 너무 ZXing Android Embedded을 변경했습니다.

이제는 매력처럼 작동합니다.

0

문제 :

나는 단지 core.jar를 포함되어 있지만, 위의 오류가 발생할 수 있으므로 또한, 관련 원격 저장소를 zxing 컴파일하고 있지 않다 알아보십시오.

해결책 :이 솔루션은 core.jar를 파일을 삭제한다

는 괜찮아요.

+0

** ** ** ** ** ** ** ** 아주 확실하지 않습니다. 그것은 무관계 한 질문과 무관 한 질문에 대한 해결책 인 것처럼 보인다.이 질문을 새 질문으로 작성하고 (아마도이 ​​질문에 대한 참조로 연결해야 함) 해결책을 제시하십시오. 자율 질문 [** here **] (https://stackoverflow.com/help/self-answer)에 대한 자세한 정보를 찾을 수 있습니다. –

+0

이 질문에 대한 답을 제공하지 않습니다. 충분한 [평판] (https://stackoverflow.com/help/whats-reputation)이 있으면 [모든 게시물에 주석 달기] (https://stackoverflow.com/help/privileges/comment) 할 수 있습니다. 대신, [질문자의 설명이 필요없는 답변을 제공하십시오] (https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- i-do- 대신). - [리뷰에서] (리뷰/저품절 포스트/17234925) – MikeT

관련 문제