app:transformClassesWithJarMergingForDebug FAILED

2020-04-01 03:33发布

when I try to run the app I am getting this error

before

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

Now

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

I referred this,this and this. Tried the solutions mentioned there. Still I am far away from solving the Issue.

Please have a look on the 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'
}

I am happy to provide more information if needed.

UPDATE

When I comment compile 'com.clevertap.android:clevertap-android-sdk:2.0.11' It is working fine.

2条回答
迷人小祖宗
2楼-- · 2020-04-01 03:47

please check if some of your dependencies have multidex as dependency and exclude it. For example for Facebook SDK: you have this

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

change to this

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

and check for other also.

查看更多
▲ chillily
3楼-- · 2020-04-01 04:03

Solved the issue by updating the com.google.android.gms:play-services version from 8.3.0 to 8.4.0

查看更多
登录 后发表回答