简体   繁体   English

Android应用程序无法生成带签名的apk,错误com.android.build.api.transform.TransformException:java.util.zip.ZipException:

[英]Android App Unable to generate signed apk with error com.android.build.api.transform.TransformException: java.util.zip.ZipException:

I was generating the APK for release, But facing following issues with the APK. 我当时正在生成要发布的APK,但是面临着APK的以下问题。

Stuck @ 卡住 @

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/gcm/PendingCallback.class

Not able to proceed further with this issue. 无法进一步解决此问题。

Tried every other possible way to get rid of this error. 尝试了其他所有可能的方法来摆脱此错误。

Here is the snapshot of my Gradle file 这是我的Gradle文件的快照

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "com.xxxxxxxxxxx.xxxxx"
        minSdkVersion 18
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        versionName getVersionName()
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        useLibrary 'org.apache.http.legacy'

    }
    dexOptions {
        jumboMode true
        javaMaxHeapSize "4g"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    defaultConfig {
        multiDexEnabled = true
        vectorDrawables.useSupportLibrary = true
    }
    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v4'
        all*.exclude group: 'com.android.support', module: 'support-annotations'
        all*.exclude module: 'play-services-awareness'

    }

}


//repositories {
//    maven { url 'https://zendesk.jfrog.io/zendesk/repo' }
//}
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:support-v4:27.1.0'
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.0'
    implementation 'com.android.support:support-vector-drawable:27.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.android.support:cardview-v7:27.1.0'
    compile 'com.github.silvestrpredko:dot-progress-bar:1.1'
    compile 'com.github.d-max:spots-dialog:0.4@aar'
    compile 'com.github.clans:fab:1.6.2'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.prolificinteractive:material-calendarview:1.4.3'
    compile 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
    compile 'com.synnapps:carouselview:0.1.4'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.lawloretienne:discreteslider:0.0.9'
    compile 'com.appyvet:materialrangebar:1.4.1'
    compile 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'

    //Swipe stack card Intergrtion
    compile 'link.fls:swipestack:0.3.0'
    compile 'in.arjsna:swipecardlib:1.0.2'
    compile 'com.borax12.materialdaterangepicker:library:1.9'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation project(':aphidFlipViewLibrary')
    compile 'com.gjiazhe:PanoramaImageView:1.0'
    implementation 'com.github.Q42:AndroidScrollingImageView:1.3.2'
    compile 'com.github.lespinsideg:SimplePanorama:0.3.1'

    compile ('co.realtime:messaging-android:2.1.58'){
        exclude group: 'com.google.android.gms', module: 'play-services'
    }
    //gmail intergation
    compile 'com.google.android.gms:play-services-auth:11.8.0'
    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.android.gms:play-services-maps:11.8.0'
    compile 'com.google.android.gms:play-services:11.8.0'
    compile 'com.google.android.gms:play-services-places:11.8.0'
    compile 'com.google.android.gms:play-services-location:11.8.0'


    compile 'com.mxn.soul:flowingdrawer-core:2.0.0'
    compile 'com.yalantis:contextmenu:1.0.7'
    compile 'com.github.florent37:materialimageloading:1.0.2'
    compile 'com.pnikosis:materialish-progress:1.7'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    compile 'com.squareup.okhttp3:okhttp:3.2.0'
    compile 'ch.acra:acra:4.6.1'
    compile 'com.github.clans:fab:1.6.2'
    compile 'com.koushikdutta.ion:ion:2.+'
    compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
    compile 'com.squareup.okio:okio:1.7.0'
    compile 'com.squareup.retrofit2:converter-gson:2.0.1'
    compile 'pub.devrel:easypermissions:0.2.0'
    compile 'com.github.silvestrpredko:dot-progress-bar:1.1'
    implementation 'com.android.support:mediarouter-v7:27.1.0'
    compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
    compile 'com.firebase:firebase-jobdispatcher:0.5.2'
    compile 'com.android.support:multidex:1.0.1'
    compile 'de.hdodenhof:circleimageview:2.2.0'

    //gcm error
    compile 'com.adjust.sdk:adjust-android-criteo:4.12.4'
    compile 'com.seatgeek:placesautocomplete:0.3-SNAPSHOT'
    implementation 'com.jakewharton:butterknife:8.4.0'
    //ZENDEX
    implementation group: 'com.zendesk', name: 'support', version: '2.0.0'
   // compile project(':sdkui')
    implementation 'com.github.takusemba:spotlight:1.3.3'

}
apply plugin: 'com.google.gms.google-services'

You are repeating multiDexEnabled = true both in default config structure. 您在默认配置结构中都重复了multiDexEnabled = true Remove one of these. 删除其中之一。

enable multidex in app module 在应用模块中启用multidex

defaultConfig {
     multiDexEnabled true
    }

    dependencies {   
        implementation'com.android.support:multidex:1.0.1'
    }

also set name attribute for application tag like 还为应用程序标记设置名称属性,例如

<application
        android:name="android.support.multidex.MultiDexApplication" >
</application>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 app:transformClassesWithJarMergingForDebug,com.android.build.api.transform.TransformException:java.util.zip.ZipException: - app:transformClassesWithJarMergingForDebug, com.android.build.api.transform.TransformException: java.util.zip.ZipException: 生成签名的APK错误:java.util.zip.ZipException - generate signed APK error : java.util.zip.ZipException com.android.build.api.transform.TransformException: - com.android.build.api.transform.TransformException: com.android.build.api.transform.TransformException - com.android.build.api.transform.TransformException 生成Apk时出错:com.android.build.api.transform.TransformException:生成主dex列表时出错 - Error Building Apk : com.android.build.api.transform.TransformException: Error while generating the main dex list TransformException:Android Studio中的java.util.zip.ZipException - TransformException: java.util.zip.ZipException in Android Studio 错误:任务&#39;:app:transformClassesWithPreDexForRelease&#39;的执行失败。 &gt; com.android.build.api.transform.TransformException - Error:Execution failed for task ':app:transformClassesWithPreDexForRelease'. > com.android.build.api.transform.TransformException android studio错误:任务&#39;:app:transformClassesWithJarMergingForDebug&#39;的执行失败。 &gt; com.android.build.api.transform.TransformException: - android studio Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: Android Gradle产生一个TransformException:java.util.zip.ZipException:在transformClassesWithDexForRelease期间打开zip文件时出错 - Android Gradle produce a TransformException: java.util.zip.ZipException: error in opening zip file during transformClassesWithDexForRelease 错误:任务&#39;:app:transformClassesWithDexForDebug&#39;的执行失败。 &gt; com.android.build.api.transform.TransformException: - Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM