2016-09-18 4 views
1

테스트 앱에 내 Samsung A5를 사용하고 프로젝트가 내 전화에서 제대로 작동하지만 다른 전화에서는 작동하지 않습니다. 그래서 내 프로젝트에서 Generate signed APK하고 싶습니다.서명 된 APK 오류를 생성합니다. java.util.zip.ZipException

Error:Execution failed for task '::transformClassesWithDexForRelease'. 
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/daimajia/androidanimations/library/BaseViewAnimator; 

내가 오류를 봤 이러한 코드는 그 오류 제거 :

multiDexEnabled true 

packagingOptions { 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/notice.txt' 
} 

을하지만 지금은 다른 예외가있다 :

하지만 예외 오류가 발생했습니다
Error:Execution failed for task ':transformClassesWithJarMergingForRelease'. 
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/daimajia/androidanimations/library/BaseViewAnimator.class 

그의 라이브러리는 내가 사용하는 라이브러리 일 수도 있지만 어떻게 처리해야할지 모르겠다. 아래 build.gradle에 모든 라이브러리입니다 :

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 

    //for compiling card view 
    compile 'com.android.support:cardview-v7:23.0.0' 
    compile 'com.android.support:recyclerview-v7:23.0.0' 

    //for sticky header 
    compile 'com.github.carlonzo.stikkyheader:core:0.0.3-SNAPSHOT' 
    compile 'com.github.ksoichiro:android-observablescrollview:1.5.0' 
    compile 'com.nineoldandroids:library:2.4.0' 
    compile 'com.melnykov:floatingactionbutton:1.0.7' 

    compile 'com.ogaclejapan.smarttablayout:library:[email protected]' 

    compile 'com.ogaclejapan.smarttablayout:utils-v4:[email protected]' 

    compile 'me.drakeet.materialdialog:library:1.3.1' 

    compile files('libs/volley.jar') 

    compile 'com.daimajia.easing:library:[email protected]' 

    compile 'com.daimajia.androidanimations:library:[email protected]' 

    //Sweet Alert Dialog 
    compile 'cn.pedant.sweetalert:library:1.3' 

    compile 'org.apmem.tools:layouts:[email protected]' 

} 

답변

2

몇 가지 ... 모든

첫째, 당신이 포함 된 제 3의 라이브러리의 대부분을 제거 할 것. 예를 들어,

//for sticky header 
compile 'com.github.carlonzo.stikkyheader:core:0.0.3-SNAPSHOT' 
compile 'com.github.ksoichiro:android-observablescrollview:1.5.0' 
compile 'com.nineoldandroids:library:2.4.0' 
compile 'com.melnykov:floatingactionbutton:1.0.7' 

사람들의 모든

compile 'com.android.volley:volley:1.0.0'

로 대체해야합니다 당신은 또한

compile 'com.ogaclejapan.smarttablayout:library:[email protected]' 
compile 'com.ogaclejapan.smarttablayout:utils-v4:[email protected]' 

compile files('libs/volley.jar')을 제거 할 수 있습니다 내가 생각하는 이름에서 구글

에서 Design Support Library에 의해 보호됩니다 또한 제거하겠습니다.

//Sweet Alert Dialog 
compile 'cn.pedant.sweetalert:library:1.3' 

compile 'org.apmem.tools:layouts:[email protected]' 

당신이 포함하고있는 프로젝트 중 많은 것들이 2 년 넘게 일하지 않았습니다. Google의 지원 라이브러리를 사용해보세요. 디자인 지원 라이브러리에서 대부분을 얻을 수 있습니다.

마지막 시점. 앱에 이러한 라이브러리가 모두 포함되어 있고 64k method limit을 전달하기 때문에 Dex 오류가 발생합니다. proguard를 사용하여 사용하지 않는 코드를 제거하고 프로젝트의 메소드 수를 줄이는 것이 좋습니다.

관련 문제