Devon Devon - 1 month ago 32
Android Question

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

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')

}

Answer

Make these versions match... so 8.4.0, not + which pulls the latest 9.8 I think, now?

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

Also, these are 1) unneccessary lines (because of compile fileTree), and 2) you should make them like the others and not use jar files.

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')