app:transformClassesWithJarMergingForDebug FAILED

时间:2016-04-21 08:01:04

标签: android android-studio gradle

当我尝试运行应用时,我收到此错误

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzsk.class

现在

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzqz$zza.class

我提到了thisthisthis。尝试了那里提到的解决方案。我仍远未解决问题。

请查看app build gradle

    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile('com.android.support:appcompat-v7:23.1.1') {
        exclude group: 'com.android.support', module: 'support-v4'
    }
    compile('com.android.support:recyclerview-v7:23.1.1') {
        exclude group: 'com.android.support', module: 'support-v4'
    }
    compile('com.android.support:cardview-v7:23.1.1') {
        exclude group: 'com.android.support', module: 'support-v4'
    }
    compile('com.android.support:design:23.1.1') {
        exclude group: 'com.android.support', module: 'support-v4'
    }
    compile 'com.facebook.android:facebook-android-sdk:4.7.0'
    compile 'com.clevertap.android:clevertap-android-sdk:2.0.11'
    compile 'com.android.support:support-v4:23.1.1'
    compile('com.google.android.gms:play-services-analytics:8.3.0')
    {
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.google.guava'
    }
    compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
    compile "com.squareup.picasso:picasso:2.4.0"
    compile('com.google.android.gms:play-services-gcm:8.3.0') {
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.google.guava'
    }
    compile('com.google.android.gms:play-services:8.3.0') {
        exclude group: 'com.android.support', module: 'support-v4'
        exclude group: 'com.google.guava'
    }
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile project(':volley')
    compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
        transitive = true;
    }
    compile 'com.android.support:multidex:'

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

如果需要,我很乐意提供更多信息。

更新

当我发表评论时compile 'com.clevertap.android:clevertap-android-sdk:2.0.11'它工作正常。

2 个答案:

答案 0 :(得分:1)

请检查您的某些依赖项是否具有 multidex 作为依赖项,排除 e。例如对于Facebook SDK:你有这个

 compile 'com.facebook.android:facebook-android-sdk:4.7.0'

更改为

compile('com.facebook.android:facebook-android-sdk:4.7.0') {
    exclude group: 'com.android.support', module: 'multidex'
}

并检查其他。

答案 1 :(得分:0)

通过更新com.google.android.gms:play-services版本解决了该问题 从8.3.0到8.4.0