重复条目:com/google/android/gms/internal/zzqv.class Android Studio [英] duplicate entry: com/google/android/gms/internal/zzqv.class Android Studio

查看:128
本文介绍了重复条目:com/google/android/gms/internal/zzqv.class Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我实现了play-services-games,首先我尝试添加
compile 'com.google.android.gms:play-services:10.0.1'
但是我遇到了麻烦,发现的解决方案是只编译所需的库 compile 'com.google.android.gms:play-services-games:10.0.1'
一切都很棒,但是当我尝试添加play-services-ads时,事情变得混乱了,我添加了
compile 'com.google.android.gms:play-services-ads:10.0.1'
现在我得到

In my project i have implemented play-services-games,first I have tried to add
compile 'com.google.android.gms:play-services:10.0.1'
but i got into some troubles and the solutions that i found was to compile only the needed library compile 'com.google.android.gms:play-services-games:10.0.1'
and all was great but when I've tried to add play-services-ads things got messy,I have added
compile 'com.google.android.gms:play-services-ads:10.0.1'
Now i get

错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败. com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复项:com/google/android/gms/internal/zzqv.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/zzqv.class

这是我的build.gradle

Here is my build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "com.apps.fightersam"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile name: 'unity-ads', ext: 'aar'
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'
    compile 'com.google.android.gms:play-services-games:10.0.1'
    compile 'com.google.android.gms:play-services-ads:10.0.1'

    compile project(':BaseGameUtils')
}
repositories {
    flatDir {
        dirs 'libs'
    }
}

推荐答案

您必须排除内部传递依赖项的重复使用. 找出

You have to exclude the duplicate use of an internal transitive dependency. To find out which

gradle -q dependencies

这将为您提供依赖关系树.然后您可以做类似的事情

This will give you the dependency tree. Then you can do something like

  compile('com.example.m:m:1.0') {
     exclude group: 'org.unwanted', module: 'x 
  }

这篇关于重复条目:com/google/android/gms/internal/zzqv.class Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆