java.util.zip.ZipException: duplicate entry:com/go

2019-07-25 07:47发布

问题:

I'm getting this issue after building app,

Execution failed for task ':appname:transformClassesWithJarMergingForDebug. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/auth/UserRecoverableAuthException.class

My dependencies in build.gradle is

dependencies {
    compile fileTree(include: '*.jar', dir: 'libs')
    compile project(':_library')
    compile project(':android-support-v7-appcompat')
    compile project(':library_pull')
    compile project(':Drag_library')
    compile 'com.google.android.gms:play-services-appindexing:8.1.0'
    compile files('libs/org.apache.http.legacy.jar')
}

回答1:

Add this to the bottom of your app's build.gradle file:

configurations.all { exclude module: 'play-services-auth' }