2017-10-24 3 views
0

meniewest, java, res와 같은 다른 파일의 코드를 추가하여 Eclipse 프로젝트로 이맥스 프로젝트를 변환합니다. 프로젝트를 실행하면 오류가 표시됩니다.오류 : 'app : transformClassesWithJarMergingForDebug'작업에 대한 실행이 실패했습니다.

방법이 오류로 읽어하려면

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 25 
buildToolsVersion "25.0.3" 
useLibrary 'org.apache.http.legacy' 

defaultConfig { 

    applicationId "com.example.tms032.demo_pos_rs" 
    minSdkVersion 19 
    targetSdkVersion 25 
    versionCode 1 
    versionName "1.0" 
    multiDexEnabled true 
    testInstrumentationRunner 
    "android.support.test.runner.AndroidJUnitRunner" 
} 


buildTypes { 
    release { 

     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro' 
    } 
} 
} 

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{ 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support:design:25.3.1' 
compile 'com.android.support:support-v4:25.3.1' 
compile 'com.android.support:multidex:1.0.1' 
compile project(':CustomCalendarView') 
compile files('libs/commons-discovery-0.2.jar') 
compile files('libs/commons-lang-2.5.jar') 
compile files('libs/gson-2.2.2.jar') 
compile files('libs/javax.wsdl_1.6.2.v201005080631.jar') 
compile files('libs/log4j-1.2.16.jar') 
compile files('libs/picasso-2.0.0.jar') 
compile files('libs/posindev.jar') 
compile files('libs/printingSDK-7.5.0-javadoc.jar') 
compile files('libs/sqljet.1.0.2.b885.jar') 
compile files('libs/upg_bridge.jar') 
testCompile 'junit:junit:4.12' 

} : 다음

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

내 Gradle을 파일? 나는 많은 해결책을 시도했다. 그러나 그들 중 누구도 작동하지 않습니다.

+1

가능한 복제 [응용 프로그램 : transformClassesWithJarMergingForDebug가 실패] (https://stackoverflow.com/questions/36763382/apptransformclasseswithjarmergingfordebug-failed) "IntegerRes.class"라는 같은 클래스를 공유하는 외부 라이브러리의 –

+0

두 그래서 하나를 제거하려고 libs 중 하나를 사용하지 않을 경우. –

+2

[중복 항목 : 'app : transformClassesWithJarMergingForDebug'] (https://stackoverflow.com/questions/42782010/duplicate-entry-for-apptransformclasseswithjarmergingfordebug)의 가능한 중복 –

답변

0
compile fileTree(include: ['*.jar'], dir: 'libs') 

compile files('libs/commons-discovery-0.2.jar') 

또한, 두 번 jar 파일을 컴파일

다른 버전과 같은 라이브러리가 문제가있을 것입니다

당신은 아래 항아리 종속성에서 제외하지만 좀처럼 수 공장.

sourceSets { 
    main { 
     java { 
      include 'com/ourcompany/somepackage/activityadapter/**' 
      include 'com/ourcompany/someotherpackage/**' 
      exclude 'com/ourcompany/someotherpackage/polling/**' 
     } 
    } 

가장 좋은 옵션은 jar 대신 repo의 새 버전을 찾는 것입니다. 의

+0

모든 컴파일 파일 종속성을 제거한 다음 프로젝트를 실행했지만 여전히 동일한 오류가 표시됩니다. –

관련 문제