Android错误重复条目:com / google / android / gms / internal / zzai $ zza.class

时间:2016-11-01 21:53:48

标签: android

我目前在运行项目时遇到了一些问题。

  

重复条目:com / google / android / gms / internal / zzai $ zza.class

错误是说我有一个重复的依赖,但我无法在任何地方看到重复!

此代码行中出现错误: compile 'com.google.android.gms:play-services-ads:8.4.0'

它说已经找到了版本9.8和8.4。我只看到版本8.4。

申请插件:' com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.tedrasoft.templategoogle"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode=7
        versionName="1.6"
        multiDexEnabled true
        manifestPlaceholders = [manifestApplicationId          : "${applicationId}",
                                onesignal_app_id               : "ed282ffa-1e9e-4dd8-9edc-cfdcbe8376bd",
                                onesignal_google_project_number: "3902815545"]
    }
    buildTypes {
        release {
            lintOptions {
                disable 'MissingTranslation'
            }
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

    dependencies {
        compile fileTree(include: ['*.jar'], dir: 'libs')
        testCompile 'junit:junit:4.12'
        compile files('libs/chartboost.jar')
        compile 'com.android.support:appcompat-v7:23.3.0'
        compile 'com.google.android.gms:play-services-ads:8.4.0'
        compile 'com.facebook.android:facebook-android-sdk:4.+'
        compile 'com.facebook.android:audience-network-sdk:4.+'
        compile 'com.onesignal:OneSignal:2.+@aar'
        compile 'com.google.android.gms:play-services-gcm:8.4.0'
        compile 'com.google.android.gms:play-services-analytics:+'
        compile 'com.google.android.gms:play-services-location:+'
        compile files('libs/jackson-annotations-2.1.0.jar')
        compile files('libs/jackson-core-2.1.0.jar')
        compile files('libs/jackson-databind-2.1.0.jar')

}

3 个答案:

答案 0 :(得分:1)

就我而言,这是因为

compile 'com.facebook.android:audience-network-sdk:4.+'

我将其更改为:

 compile ('com.facebook.android:audience-network-sdk:4.+'){
        exclude group:"com.google.android.gms"
    }

没有问题!

答案 1 :(得分:0)

将Google Play服务(地图,位置和gcm)从9.0.0升级到9.2.0

compile 'com.google.android.gms:play-services-location:9.2.0'
compile 'com.google.android.gms:play-services-maps:9.2.0'
compile 'com.google.android.gms:play-services-gcm:9.2.0'

然后添加此依赖项:

compile 'com.google.android.gms:play-services-places:9.2.0'

答案 2 :(得分:0)

让这些版本匹配......所以8.4.0,而不是+,我现在认为它是最新的9.8

compile 'com.google.android.gms:play-services-analytics:+'
compile 'com.google.android.gms:play-services-location:+'

另外,这些是1)不必要的行(因为compile fileTree),2)你应该make them like the others而不使用jar文件。

compile files('libs/jackson-annotations-2.1.0.jar')
compile files('libs/jackson-core-2.1.0.jar')
compile files('libs/jackson-databind-2.1.0.jar')