2017-05-13 7 views
-1

지원해 주셔서 감사합니다. 내 문제가 있습니다 :안드로이드 스튜디오에서 mulitedex에 의존하는 중복 클래스

Error:Execution failed for task ':androidKeyboardThemes:transformClassesWithJarMergingForRelease'.

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/location/ActivityRecognition$1.class

내 Gradle을 dependecies은 논문 : 나는 실행 종속을 추가하고 서명 된 APK를 내보낼 때, 나는이 오류 얻을

dependencies { 
    compile project(':cropper') 
    compile 'com.google.android.gms:play-services:+' 
    compile files('libs/StartAppInApp-2.4.7.jar') 
    compile files('libs/google-play-services.jar') 
    compile 'com.android.support:multidex:1.0.1' 
} 

을 나는 하나의 lib 디렉토리를 삭제하려고했습니다 또는 항아리를 언제든지 다시 만들 수 있지만 일을 끝내지 못했습니다. 또한 stackoverflow에서 중복 된 클래스에 대한 모든 unswer를 읽었지만 내 문제를 해결하지 못했습니다. 아이디어가 있으십니까?, 고맙습니다.

답변

0
dependencies { 
compile project(':cropper') 
compile 'com.google.android.gms:play-services:+' <-- choose either one 
compile files('libs/StartAppInApp-2.4.7.jar') 
compile files('libs/google-play-services.jar')  <-- choose either one 
compile 'com.android.support:multidex:1.0.1' 
} 

무엇이든지간에 play-services를 사용하지 마십시오. 'com.google.android.gms : play-services : +'에 의존성이 많이 있습니다. 아래를 참조하십시오. play-services를 사용하면 dex 문제가 발생하고 앱이 많이 발생할 수 있습니다. 참조하시기 바랍니다 here

+0

감사합니다. 그것은이 작동 : ** Gradle을 : ** '종속 { 컴파일 프로젝트 ('농작물') 컴파일 'com.google.android.gms : 플레이 서비스 플러스 : 10.2.1' // 지불,지도 및 위치를 제외한 모든 항목 'com.google.android.gms : play-services-games : 10.2.1' ('libs/StartAppInApp-2.4.7.jar') 파일을 컴파일하십시오. // 파일을 컴파일 ('libs/google-play-services.jar') 'com.android.support:multidex:1.0.1 }' 을 컴파일하십시오.하지만 여전히 내 장치에 APK를 설치하면 85 에스. 모든 주요 문제가 해결됩니다, @Saurabh 및 @ ZeroOne 감사합니다. – Seben