2016-09-05 6 views
1

FAILURE : 예외가 발생하여 빌드가 실패했습니다. 잘못된 무엇스튜디오에서 지원 v4 라이브러리를 제외하는 방법은 무엇입니까?

  • : 'transformClassesWithJarMergingForDebug' 실행은 작업에 실패했습니다.

    com.android.build.api.transform.TransformException : java.util.zip.ZipException : 중복 된 항목 : 안드로이드/지원/V4/컨텐츠/로더 $ OnLoadCompleteListener.class

build.gradle 파일

코드

apply plugin: 'com.android.application' 


dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    //compile project(':ActionBarSherlock-4.1.0') 
    compile project(':GooglePlayServicesLibrary') 
    compile files('libs/eventbus-2.4.0.jar') 
    compile (project(':AndroidBetterPickers')){ exclude module: 'support-v4' } 
    compile (project(':ZxingFragmentLib')){ exclude module: 'support-v4' } 
    compile (project(':RobotoTextView')){ exclude module: 'support-v4' } 
    compile (project(':PanesLibrary')){ exclude module: 'support-v4' } 
    compile (project(':ShowCaseViewLibrary')){ exclude module: 'support-v4' } 
    compile (project(':ActionBarSherlock-4.1.0')){ exclude module: 'support-v4' } 



} 

buildscript { 
    repositories { 
     jcenter() 
     mavenCentral() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:2.1.3' 
    } 



} 

allprojects { 
    repositories { 
     jcenter() 
     mavenCentral() 
    } 
} 



android { 
    packagingOptions { 

     exclude 'META-INF/maven/com.nineoldandroids/library/pom.xml' 
     exclude 'META-INF/maven/com.nineoldandroids/library/pom.properties' 
     exclude 'META-INF/services/javax.annotation.processing.Processor' 

    } 



    dexOptions { 
     javaMaxHeapSize "4g" 
    } 
    compileSdkVersion 19 
    buildToolsVersion '22.0.1' 

    defaultConfig { 
     minSdkVersion 15 
     targetSdkVersion 15 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 




    sourceSets { 
     main { 
      manifest.srcFile 'AndroidManifest.xml' 
      java.srcDirs = ['.apt_generated','res','src'] 
      resources.srcDirs = ['.apt_generated','res','src'] 
      aidl.srcDirs = ['.apt_generated','res','src'] 
      renderscript.srcDirs = ['.apt_generated','res','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') 
    } 




} 
+0

의 버그가 왜 ..... 모른다 귀하의 Gradle 파일은 다음과 같습니다. 오류는 중복 된 항목을 가리키며, 두 번 이상을 포함했을 수 있음을 나타냅니다. – ishmaelMakitla

+0

@ishmaelMakitla 위의 파일은 내 build.gradle 파일입니다. –

답변

5

나는이

dependencies { 
    api('com.android.support:recyclerview-v7:22.2.0') { 
     exclude module: 'support-v4' 
    } 
} 
처럼 그것을 한 적이
+0

나는 그것을 지원하는 모든 라이브러리에 동일한 작업을 수행했다. 그러나 그것은 나를 도왔다. –

+0

Google Play 서비스 API는 [매우 큰] (https://developers.google.com/android/guides/setup) 일 수도 있습니다. 아마도 일부 api 만 필요할 것입니다. 문제로 돌아 가기 : gradle dependencies 명령을 사용해보십시오. 그러면 프로젝트 종속성이 트리 형식으로 표시됩니다. –

+0

+ --- 프로젝트 : GooglePlayServicesLibrary + --- 프로젝트 : AndroidBetterPickers + --- 프로젝트 : ZxingFragmentLib + --- 프로젝트 : RobotoTextView + --- 프로젝트 : PanesLibrary | \ --- project : ActionBarSherlock-4.1.0 + --- project : ShowCaseViewLibrary \ --- project : 아래의 ActionBarSherlock-4.1.0은 gradle 종속성을위한 트리입니다. –

0

6,내가 컴파일 리셋 구현 한 후, 같은 문제를 가지고, 그것을 잘 작동,하지만 난 아마이 방법을 볼 우리를 보자 '구현'

0
dependencies { 
    compile fileTree(dir: 'libs', include: '*.jar') 
    // compile project(':ActionBarSherlock-4.1.0') 
    compile project(':GooglePlayServicesLibrary') 
    compile files('libs/eventbus-2.4.0.jar') 
    compile (project(':AndroidBetterPickers')) 
    compile (project(':ZxingFragmentLib')) 
    compile (project(':RobotoTextView')) 
    compile (project(':PanesLibrary')) 
    compile (project(':ShowCaseViewLibrary')) 
    compile (project(':ActionBarSherlock-4.1.0')) 
compile files('libs/support-v4-19.0.1.jar')