2

アプリ/ build.gradleはアンドロイドAPKエラーを構築するために失敗しました:持つZipException:エントリを複製:ORG/ObjectWebの/ ASM/AnnotationVisitor.class

は以前、この同じプロジェクトは、Androidスタジオ1.5で正常に動作しますが、アンドロイドスタジオを更新した後、 2.1.1 apkファイルを作成できませんでした。エラーメッセージ:エラー:タスク ':app:transformClassesWithJarMergingForRelease'の実行に失敗しました。

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/objectweb/asm/AnnotationVisitor.class

し、エラーをリリースAPKを構築しようとしているの包みです:エラー:実行は、タスクに失敗しました「:アプリ:transformClassesWithJarMergingForRelease」。

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/objectweb/asm/commons/AdviceAdapter.class

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.3" 
    useLibrary 'org.apache.http.legacy' 
    defaultConfig { 
//  generatedDensities = [] 
     applicationId "com.view9.lacuna" 
     minSdkVersion 15 
     targetSdkVersion 23 
     versionCode 3 
     versionName "3.0" 
     multiDexEnabled true 
     signingConfig signingConfigs.newSigningConfig 
    } 
    dexOptions { 
     javaMaxHeapSize "4g" 
     jumboMode = true 
     incremental true 
     preDexLibraries = false 

    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      debuggable false 
      signingConfig signingConfigs.newSigningConfig 
     } 
     debug { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
      debuggable true 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/BCKEY.DSA' 
     exclude 'AUTHORS' 
     exclude 'META-INF/BCKEY.SF' 
     exclude 'META-INF/services/javax.annotation.processing.Processor' 
    } 
    aaptOptions { 
     additionalParameters "--no-version-vectors" 
    } 
    lintOptions { 
     checkReleaseBuilds false 
     // Or, if you prefer, you can continue to check for errors in release builds, 
     // but continue the build even when errors are found: 
     abortOnError false 

     // set to true to turn off analysis progress reporting by lint 
     quiet false 
     // if true, stop the gradle build if errors are found 
     abortOnError true 
     // if true, only report errors 
     ignoreWarnings false 
     // turn off checking the given issue id's 
     disable 'TypographyFractions', 'TypographyQuotes' 
     // if true, generate a text report of issues (false by default) 
     textReport true 
    } 
    productFlavors { 
    } 
} 

repositories { 
    maven { url "https://jitpack.io" } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.tools.build:gradle:2.0.0' 
    compile('com.android.support:appcompat-v7:23.0.0') { 
     exclude module: 'support-v4' 
    } 
    compile 'com.google.android.gms:play-services:9.0.2' 
    compile 'it.sephiroth.android.library.horizontallistview:hlistview:1.2.2' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.mcxiaoke.volley:library-aar:1.0.0' 
    compile 'com.android.support:design:23.0.0' 
    compile 'com.android.support:recyclerview-v7:23.0.0' 
    compile 'fr.baloomba:viewpagerindicator:2.4.2' 
    compile 'com.pkmmte.view:circularimageview:1.1' 
    compile 'com.github.clans:fab:1.5.5' 
    compile 'com.github.jorgecastilloprz:fabprogresscircle:[email protected]' 
    compile 'commons-validator:commons-validator:1.4.0' 
    compile 'it.neokree:MaterialTabs:0.11' 
    compile 'se.emilsjolander:StickyScrollViewItems:1.1.0' 
    compile('org.apache.httpcomponents:httpmime:4.4.1') { 
     exclude module: 'httpclient' 
    } 
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5' 
    compile('com.github.afollestad.material-dialogs:core:[email protected]') { 
     transitive = true 
    } 
    compile 'com.squareup:otto:1.3.5' 
    compile 'com.android.support:multidex:1.0.1' 

} 

答えて

0

私は、同様に数日間、この1と同じ正確なエラー逐語を苦労。私はすべての答えを読んで見つけて、自分のgradleファイルに物事を追加し続けましたが、何も動かないようでした。だから、私は別の道を進み、私の問題を単純化した。

1.)Android Studioが作成時に追加するものを除いて、内部に何も入っていない新しいモジュールから始めました。アプリをデバッグし、署名されたAPKを構築しました。これは私のベースラインになるだろう。

2.)私が必要としていたライブラリを、デバイスにデバッグし、それぞれの後に署名付きapkを作成することから始めます。基本的な前提は、ベースラインがデバッグされ、うまく構築されているため、その能力を壊すライブラリがすべて犯人であることです。

3)最後に私の場合、犯人に来た:この行では

compile 'com.google.gms:google-services:2.1.2' 

をアプリがデバッグするだろうが、署名リリースAPKを構築するので、私はラインを削除して、再度試してもいないでしょう含ま期待どおりに働いた。

この設定でテストした後、私はそれを必要としませんでした。それがなぜ必要ではなかったのかは分かりませんが、これは私にとってはうまくいきました。明らかに、この同じ正確な問題はありませんが、私はGoogleのライブラリと関係があることを確信しています。お役に立てれば!

+1

私の場合は、新しいコードでプロジェクトを再作成し、ライブラリを賢明かつ慎重に実装することで、この問題を解決しました。 – jazzbpn

関連する問題