【问题标题】:com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzel.classcom.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/google/android/gms/internal/zzel.class
【发布时间】:2016-08-31 06:52:28
【问题描述】:

这是我的 gradle 文件。我遇到了这个问题

错误:任务执行失败 ':crushmatic:transformClassesWithJarMergingForDebug'.

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目: com/google/android/gms/internal/zzel.class

android {

    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'

        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
        }
    }

    dexOptions {    
        javaMaxHeapSize "4g"    
    }

    defaultConfig {    
        applicationId "com.crushmatic.pro"
        minSdkVersion 14
        targetSdkVersion 23
        multiDexEnabled true
    }

    android {    
        useLibrary 'org.apache.http.legacy'
    }

    repositories {    
        maven {
            url "https://mint.splunk.com/gradle/"    
        }    
    }

    buildTypes {

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

我的依赖:

dependencies {

    compile 'com.android.support:multidex:1.0.0'
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile project(':facebookSDK')
    compile project(':rangeBar')
    compile project(':seekArc_library')
    compile project(':volley')
    compile project(':zoomimage')
    compile files('libs/android-query.0.25.10.jar')
    compile files('libs/asmack-android-8.jar')
    compile files('libs/commons-codec-1.4.jar')
    compile files('libs/eventbus-2.1.0-beta-1.jar')
    compile files('libs/httpmime-4.1.3.jar')
    compile 'com.github.bumptech.glide:glide:3.5.1'
    compile files('libs/PayPalAndroidSDK-2.8.5.jar');

    compile files('libs/picasso-2.1.1.jar')
    compile files('libs/sinch-android-rtc-3.9.8.jar')

    compile 'joda-time:joda-time:2.1'

    compile 'com.google.code.gson:gson:2.2.2'
    compile 'com.google.android.gms:play-services:7.3.0'
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.+'

    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.pkmmte.view:circularimageview:1.1'
    compile 'com.joooonho:selectableroundedimageview:1.0.1'
    compile 'com.splunk.mint:mint:4.3.0'
    compile files('libs/gcm.jar')    
}

谁能帮我解决这个问题

【问题讨论】:

  • this的可能重复
  • 检查任何重复的库或旧版本是否使用
  • 没有重复的库..你能帮我解决这个问题吗
  • 首先:将你的.jar依赖转换为gradle依赖。你没有,这就是你有问题的原因。然后在控制台中运行命令来检查依赖关系。
  • 对不起,我是初学者。如何将 .jar 依赖转换为 gradle 依赖

标签: android gradle


【解决方案1】:

您可以在 Android Studio 终端上使用此命令:

1

./gradlew :app:dependencies

2

./gradlew clean (Android ---> Clean the Project)

3

./gradlew clean assembleDebug | ./gradlew clean:assembleDebug

通过您编写的这些内容,您正在清理和重建项目。特别是第一个,您将删除项目中所有重复和错误的内容。

让我知道这是否有效!我修复了我的项目。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-14
    • 1970-01-01
    相关资源
    最近更新 更多