Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Error duplicate entry: com/google/android/gms/internal/zzai$zza.class

Tags:

android

I am currently having some trouble running my project.

duplicate entry: com/google/android/gms/internal/zzai$zza.class

The error is saying that I have a duplicate dependency, but I can't see a duplicate anywhere!

The error appears on this line of code: compile 'com.google.android.gms:play-services-ads:8.4.0'

It says that it has found versions 9.8 and 8.4. I only see version 8.4 though.

apply plugin: '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')

}
like image 640
Devon Avatar asked Jun 22 '26 15:06

Devon


1 Answers

In my case, it's because of the

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

I change it to this:

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

No more problem!

like image 187
Hai nguyen thanh Avatar answered Jun 24 '26 04:06

Hai nguyen thanh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!