마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

duplicate entry 에러

0 추천

안녕하세요 아래와 같은 에러가 나와요 

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/Size.class

환경은 libs / android-support-v4.jar 저장되있습니다.

경험하셨거나, 아시는 분이 있으면 제발 가르쳐 주세요 ㅠ

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support:appcompat-v7:23.3.0'
    compile 'com.android.support:design:23.3.0'
    compile files('libs/android-support-v4.jar')
     compile 'com.google.android.gms:play-services:9.0.2
 
익명사용자 님이 2016년 6월 20일 질문

1개의 답변

0 추천
duplicate라는게 android-support-v4.jar 의 Size 클래스가 중복된듯 합니다.

아무래도 다른 jar파일에 해당 정보가 포함된 것으로 보입니다.

android-support-v4.jar를 지우고 해 보세요..

보다 자세한 사항은 아래 링크를 보시구요.

http://stackoverflow.com/questions/26966843/java-util-zip-zipexception-duplicate-entry-during-packagealldebugclassesformult
익명사용자 님이 2016년 6월 20일 답변
감사합니다.

compile 'com.google.android.gms:play-services:8.4.0'

을 사용하고 있었는데, 조언해주신대로 내용안에 중복된 내용이 있어서 오류가
난것 같습니다.

android-support-v4.jar 파일 지우고 dependencies에서도 지우니까 해결되었습니다.

감사합니다.
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.naver.maps.open:naver-map-api:2.1.1@aar'
    compile 'com.naver.maps.open:naver-map-api:2.1.2@aar'
    testCompile 'junit:junit:4.12'
}
저도 중복되었다는데 멀 지워야 하나요ㅜㅜ
...