Error:Program type already present: com.google.android.gms.internal.measurement.zzdz











up vote
-2
down vote

favorite












This Error Appears during Gradle Build




Error:Program type already present: com.google.android.gms.internal.measurement.zzdz



I hope to find some help for this error
Gradle files for my project
Gradle build(Module:App)




apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 27
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "com.msk.obourschools"
minSdkVersion 21
targetSdkVersion 27
versionCode 9
versionName "1.0.7"
testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
// kapt { generateStubs = true }

}

// dexOptions { javaMaxHeapSize "4g" }

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
abortOnError false
}

configurations.all {
//This is library is included with two different versions
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.anko:anko:0.10.4"
implementation 'com.android.support:multidex:1.0.3'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-ads:17.1.0'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.google.android:flexbox:1.1.0'
implementation 'com.iarcuschin:simpleratingbar:0.1.3'
implementation 'com.github.hotchemi:android-rate:1.0.1'


//login

//Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"


//Support
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:appcompat- v7:$rootProject.ext.supportLibVersion"
implementation "com.android.support:support-v4:$rootProject.ext.supportLibVersion"
testImplementation 'com.android.support.test:runner:1.0.2'
testImplementation 'com.android.support.test.espresso:espresso- core:3.0.2'

//Firebase
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation "com.google.firebase:firebase-auth:16.0.5"
implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-messaging:17.3.4"
implementation 'com.google.firebase:firebase-config:16.1.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.firebaseui:firebase-ui-database:3.3.1'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-analytics:16.0.5'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.3'
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
implementation 'com.google.firebase:firebase-perf:16.2.0'


//google services
implementation "com.google.android.gms:play-services-auth:16.0.1"
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.android.gms:play-services-tagmanager:16.0.5"


//Mini
implementation 'com.github.pabloogc:Mini:1.0.1'
annotationProcessor 'com.github.pabloogc.Mini:mini-processor:1.0.1'

//Dagger
implementation "com.google.dagger:dagger-android:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"

//Rx
implementation "io.reactivex.rxjava2:rxjava:$rx_version"
implementation "io.reactivex.rxjava2:rxandroid:$rx_android_version"
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'

//Test
testImplementation 'junit:junit:4.12'
testImplementation 'com.natpryce:hamkrest:1.4.2.0'
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation 'org.junit.platform:junit-platform-runner:1.0.1'
testImplementation "junit:junit:$rootProject.ext.junitVersion"

//Guava
implementation 'com.google.guava:guava:27.0-jre'
// or, for Android:
api 'com.google.guava:guava:27.0-android'

}

repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
}
apply plugin: 'com.google.gms.google-services'



Gradle Build(Project)




// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
kotlin_version = '1.2.51'
espressoVersion = '3.0.1'
junitVersion = '4.12'
supportLibVersion = '27.0.2'
supportTestVersion = '1.0.1'
//login
gson_version = "2.8.2"
dagger_version = "2.15"
rx_version = "2.1.8"
glide_version = "4.7.1"
rx_firebase_version = "1.1.3"
support_version = "27.1.1"
rx_android_version = "2.0.2"
target_sdk_version = 27
googlePlayServicesVersion = "16.0.1"

}
repositories {
google()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
maven { url 'http://raw.github.com/saki4510t/libcommon/master /repository/' }
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.fabric.io/public" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


}

allprojects {
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
maven { url "https://jitpack.io" }
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}

configurations.all {
resolutionStrategy {
// react-native-google-analytics-bridge
force "com.google.android.gms:play-services-analytics:16.0.1"
force "com.google.android.gms:play-services-tagmanager-v4-impl:16.0.1"
// react-native-device-info
force "com.google.android.gms:play-services-gcm:15.0.0"
}
}

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}


I tried all the solutions, but the error still appears and updates all Firebase and Google libraries and no new










share|improve this question
























  • You included implementation 'com.android.support:design:27.1.1' twice
    – Zoe
    Nov 10 at 13:32










  • And you occasionally use supportLibVersion which equals 27.0.2, while other times you use 27.1.1. Kotlin is at 1.3.0. Gson is at 2.8.5. Update your dependencies.
    – TheWanderer
    Nov 10 at 13:38










  • @TheWanderer..I update all as you send and error still appears
    – MahrousMansour
    Nov 10 at 14:47















up vote
-2
down vote

favorite












This Error Appears during Gradle Build




Error:Program type already present: com.google.android.gms.internal.measurement.zzdz



I hope to find some help for this error
Gradle files for my project
Gradle build(Module:App)




apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 27
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "com.msk.obourschools"
minSdkVersion 21
targetSdkVersion 27
versionCode 9
versionName "1.0.7"
testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
// kapt { generateStubs = true }

}

// dexOptions { javaMaxHeapSize "4g" }

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
abortOnError false
}

configurations.all {
//This is library is included with two different versions
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.anko:anko:0.10.4"
implementation 'com.android.support:multidex:1.0.3'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-ads:17.1.0'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.google.android:flexbox:1.1.0'
implementation 'com.iarcuschin:simpleratingbar:0.1.3'
implementation 'com.github.hotchemi:android-rate:1.0.1'


//login

//Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"


//Support
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:appcompat- v7:$rootProject.ext.supportLibVersion"
implementation "com.android.support:support-v4:$rootProject.ext.supportLibVersion"
testImplementation 'com.android.support.test:runner:1.0.2'
testImplementation 'com.android.support.test.espresso:espresso- core:3.0.2'

//Firebase
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation "com.google.firebase:firebase-auth:16.0.5"
implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-messaging:17.3.4"
implementation 'com.google.firebase:firebase-config:16.1.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.firebaseui:firebase-ui-database:3.3.1'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-analytics:16.0.5'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.3'
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
implementation 'com.google.firebase:firebase-perf:16.2.0'


//google services
implementation "com.google.android.gms:play-services-auth:16.0.1"
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.android.gms:play-services-tagmanager:16.0.5"


//Mini
implementation 'com.github.pabloogc:Mini:1.0.1'
annotationProcessor 'com.github.pabloogc.Mini:mini-processor:1.0.1'

//Dagger
implementation "com.google.dagger:dagger-android:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"

//Rx
implementation "io.reactivex.rxjava2:rxjava:$rx_version"
implementation "io.reactivex.rxjava2:rxandroid:$rx_android_version"
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'

//Test
testImplementation 'junit:junit:4.12'
testImplementation 'com.natpryce:hamkrest:1.4.2.0'
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation 'org.junit.platform:junit-platform-runner:1.0.1'
testImplementation "junit:junit:$rootProject.ext.junitVersion"

//Guava
implementation 'com.google.guava:guava:27.0-jre'
// or, for Android:
api 'com.google.guava:guava:27.0-android'

}

repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
}
apply plugin: 'com.google.gms.google-services'



Gradle Build(Project)




// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
kotlin_version = '1.2.51'
espressoVersion = '3.0.1'
junitVersion = '4.12'
supportLibVersion = '27.0.2'
supportTestVersion = '1.0.1'
//login
gson_version = "2.8.2"
dagger_version = "2.15"
rx_version = "2.1.8"
glide_version = "4.7.1"
rx_firebase_version = "1.1.3"
support_version = "27.1.1"
rx_android_version = "2.0.2"
target_sdk_version = 27
googlePlayServicesVersion = "16.0.1"

}
repositories {
google()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
maven { url 'http://raw.github.com/saki4510t/libcommon/master /repository/' }
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.fabric.io/public" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


}

allprojects {
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
maven { url "https://jitpack.io" }
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}

configurations.all {
resolutionStrategy {
// react-native-google-analytics-bridge
force "com.google.android.gms:play-services-analytics:16.0.1"
force "com.google.android.gms:play-services-tagmanager-v4-impl:16.0.1"
// react-native-device-info
force "com.google.android.gms:play-services-gcm:15.0.0"
}
}

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}


I tried all the solutions, but the error still appears and updates all Firebase and Google libraries and no new










share|improve this question
























  • You included implementation 'com.android.support:design:27.1.1' twice
    – Zoe
    Nov 10 at 13:32










  • And you occasionally use supportLibVersion which equals 27.0.2, while other times you use 27.1.1. Kotlin is at 1.3.0. Gson is at 2.8.5. Update your dependencies.
    – TheWanderer
    Nov 10 at 13:38










  • @TheWanderer..I update all as you send and error still appears
    – MahrousMansour
    Nov 10 at 14:47













up vote
-2
down vote

favorite









up vote
-2
down vote

favorite











This Error Appears during Gradle Build




Error:Program type already present: com.google.android.gms.internal.measurement.zzdz



I hope to find some help for this error
Gradle files for my project
Gradle build(Module:App)




apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 27
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "com.msk.obourschools"
minSdkVersion 21
targetSdkVersion 27
versionCode 9
versionName "1.0.7"
testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
// kapt { generateStubs = true }

}

// dexOptions { javaMaxHeapSize "4g" }

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
abortOnError false
}

configurations.all {
//This is library is included with two different versions
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.anko:anko:0.10.4"
implementation 'com.android.support:multidex:1.0.3'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-ads:17.1.0'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.google.android:flexbox:1.1.0'
implementation 'com.iarcuschin:simpleratingbar:0.1.3'
implementation 'com.github.hotchemi:android-rate:1.0.1'


//login

//Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"


//Support
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:appcompat- v7:$rootProject.ext.supportLibVersion"
implementation "com.android.support:support-v4:$rootProject.ext.supportLibVersion"
testImplementation 'com.android.support.test:runner:1.0.2'
testImplementation 'com.android.support.test.espresso:espresso- core:3.0.2'

//Firebase
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation "com.google.firebase:firebase-auth:16.0.5"
implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-messaging:17.3.4"
implementation 'com.google.firebase:firebase-config:16.1.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.firebaseui:firebase-ui-database:3.3.1'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-analytics:16.0.5'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.3'
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
implementation 'com.google.firebase:firebase-perf:16.2.0'


//google services
implementation "com.google.android.gms:play-services-auth:16.0.1"
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.android.gms:play-services-tagmanager:16.0.5"


//Mini
implementation 'com.github.pabloogc:Mini:1.0.1'
annotationProcessor 'com.github.pabloogc.Mini:mini-processor:1.0.1'

//Dagger
implementation "com.google.dagger:dagger-android:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"

//Rx
implementation "io.reactivex.rxjava2:rxjava:$rx_version"
implementation "io.reactivex.rxjava2:rxandroid:$rx_android_version"
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'

//Test
testImplementation 'junit:junit:4.12'
testImplementation 'com.natpryce:hamkrest:1.4.2.0'
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation 'org.junit.platform:junit-platform-runner:1.0.1'
testImplementation "junit:junit:$rootProject.ext.junitVersion"

//Guava
implementation 'com.google.guava:guava:27.0-jre'
// or, for Android:
api 'com.google.guava:guava:27.0-android'

}

repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
}
apply plugin: 'com.google.gms.google-services'



Gradle Build(Project)




// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
kotlin_version = '1.2.51'
espressoVersion = '3.0.1'
junitVersion = '4.12'
supportLibVersion = '27.0.2'
supportTestVersion = '1.0.1'
//login
gson_version = "2.8.2"
dagger_version = "2.15"
rx_version = "2.1.8"
glide_version = "4.7.1"
rx_firebase_version = "1.1.3"
support_version = "27.1.1"
rx_android_version = "2.0.2"
target_sdk_version = 27
googlePlayServicesVersion = "16.0.1"

}
repositories {
google()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
maven { url 'http://raw.github.com/saki4510t/libcommon/master /repository/' }
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.fabric.io/public" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


}

allprojects {
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
maven { url "https://jitpack.io" }
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}

configurations.all {
resolutionStrategy {
// react-native-google-analytics-bridge
force "com.google.android.gms:play-services-analytics:16.0.1"
force "com.google.android.gms:play-services-tagmanager-v4-impl:16.0.1"
// react-native-device-info
force "com.google.android.gms:play-services-gcm:15.0.0"
}
}

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}


I tried all the solutions, but the error still appears and updates all Firebase and Google libraries and no new










share|improve this question















This Error Appears during Gradle Build




Error:Program type already present: com.google.android.gms.internal.measurement.zzdz



I hope to find some help for this error
Gradle files for my project
Gradle build(Module:App)




apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 27
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "com.msk.obourschools"
minSdkVersion 21
targetSdkVersion 27
versionCode 9
versionName "1.0.7"
testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
// kapt { generateStubs = true }

}

// dexOptions { javaMaxHeapSize "4g" }

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
abortOnError false
}

configurations.all {
//This is library is included with two different versions
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.anko:anko:0.10.4"
implementation 'com.android.support:multidex:1.0.3'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-ads:17.1.0'
implementation 'com.github.chrisbanes:PhotoView:2.1.3'
implementation 'com.google.android:flexbox:1.1.0'
implementation 'com.iarcuschin:simpleratingbar:0.1.3'
implementation 'com.github.hotchemi:android-rate:1.0.1'


//login

//Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"


//Support
//noinspection GradleCompatible
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation "com.android.support:appcompat-v7:$support_version"
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:appcompat- v7:$rootProject.ext.supportLibVersion"
implementation "com.android.support:support-v4:$rootProject.ext.supportLibVersion"
testImplementation 'com.android.support.test:runner:1.0.2'
testImplementation 'com.android.support.test.espresso:espresso- core:3.0.2'

//Firebase
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation "com.google.firebase:firebase-auth:16.0.5"
implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-messaging:17.3.4"
implementation 'com.google.firebase:firebase-config:16.1.0'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.firebaseui:firebase-ui-database:3.3.1'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-analytics:16.0.5'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.3'
implementation 'com.google.firebase:firebase-ml-vision:18.0.1'
implementation 'com.google.firebase:firebase-ml-vision-image-label-model:17.0.2'
implementation 'com.google.firebase:firebase-perf:16.2.0'


//google services
implementation "com.google.android.gms:play-services-auth:16.0.1"
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation "com.google.android.gms:play-services-base:16.0.1"
implementation "com.google.android.gms:play-services-tagmanager:16.0.5"


//Mini
implementation 'com.github.pabloogc:Mini:1.0.1'
annotationProcessor 'com.github.pabloogc.Mini:mini-processor:1.0.1'

//Dagger
implementation "com.google.dagger:dagger-android:$dagger_version"
implementation "com.google.dagger:dagger-android-support:$dagger_version"
kapt "com.google.dagger:dagger-compiler:$dagger_version"
kapt "com.google.dagger:dagger-android-processor:$dagger_version"

//Rx
implementation "io.reactivex.rxjava2:rxjava:$rx_version"
implementation "io.reactivex.rxjava2:rxandroid:$rx_android_version"
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'

//Test
testImplementation 'junit:junit:4.12'
testImplementation 'com.natpryce:hamkrest:1.4.2.0'
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
testImplementation 'org.junit.platform:junit-platform-runner:1.0.1'
testImplementation "junit:junit:$rootProject.ext.junitVersion"

//Guava
implementation 'com.google.guava:guava:27.0-jre'
// or, for Android:
api 'com.google.guava:guava:27.0-android'

}

repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
}
apply plugin: 'com.google.gms.google-services'



Gradle Build(Project)




// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
kotlin_version = '1.2.51'
espressoVersion = '3.0.1'
junitVersion = '4.12'
supportLibVersion = '27.0.2'
supportTestVersion = '1.0.1'
//login
gson_version = "2.8.2"
dagger_version = "2.15"
rx_version = "2.1.8"
glide_version = "4.7.1"
rx_firebase_version = "1.1.3"
support_version = "27.1.1"
rx_android_version = "2.0.2"
target_sdk_version = 27
googlePlayServicesVersion = "16.0.1"

}
repositories {
google()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
maven { url 'http://raw.github.com/saki4510t/libcommon/master /repository/' }
jcenter()
maven { url "https://jitpack.io" }
maven { url "https://maven.fabric.io/public" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}


}

allprojects {
repositories {
mavenCentral()
maven { url "http://dl.bintray.com/jetbrains/spek" }
maven { url "https://jitpack.io" }
google()
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}

configurations.all {
resolutionStrategy {
// react-native-google-analytics-bridge
force "com.google.android.gms:play-services-analytics:16.0.1"
force "com.google.android.gms:play-services-tagmanager-v4-impl:16.0.1"
// react-native-device-info
force "com.google.android.gms:play-services-gcm:15.0.0"
}
}

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}


I tried all the solutions, but the error still appears and updates all Firebase and Google libraries and no new







android kotlin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 12:05









Zoe

10.9k73675




10.9k73675










asked Nov 10 at 13:30









MahrousMansour

14




14












  • You included implementation 'com.android.support:design:27.1.1' twice
    – Zoe
    Nov 10 at 13:32










  • And you occasionally use supportLibVersion which equals 27.0.2, while other times you use 27.1.1. Kotlin is at 1.3.0. Gson is at 2.8.5. Update your dependencies.
    – TheWanderer
    Nov 10 at 13:38










  • @TheWanderer..I update all as you send and error still appears
    – MahrousMansour
    Nov 10 at 14:47


















  • You included implementation 'com.android.support:design:27.1.1' twice
    – Zoe
    Nov 10 at 13:32










  • And you occasionally use supportLibVersion which equals 27.0.2, while other times you use 27.1.1. Kotlin is at 1.3.0. Gson is at 2.8.5. Update your dependencies.
    – TheWanderer
    Nov 10 at 13:38










  • @TheWanderer..I update all as you send and error still appears
    – MahrousMansour
    Nov 10 at 14:47
















You included implementation 'com.android.support:design:27.1.1' twice
– Zoe
Nov 10 at 13:32




You included implementation 'com.android.support:design:27.1.1' twice
– Zoe
Nov 10 at 13:32












And you occasionally use supportLibVersion which equals 27.0.2, while other times you use 27.1.1. Kotlin is at 1.3.0. Gson is at 2.8.5. Update your dependencies.
– TheWanderer
Nov 10 at 13:38




And you occasionally use supportLibVersion which equals 27.0.2, while other times you use 27.1.1. Kotlin is at 1.3.0. Gson is at 2.8.5. Update your dependencies.
– TheWanderer
Nov 10 at 13:38












@TheWanderer..I update all as you send and error still appears
– MahrousMansour
Nov 10 at 14:47




@TheWanderer..I update all as you send and error still appears
– MahrousMansour
Nov 10 at 14:47












1 Answer
1






active

oldest

votes

















up vote
0
down vote













In your app level gradle file downgrade



implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'


to



    implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-functions:16.1.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.firebase:firebase-invites:16.0.4'


Remove implementation 'com.google.firebase:firebase-crash:16.2.1' from your project as it is deprecated.



And Remove implementation 'com.google.firebase:firebase-analytics:16.0.5' as it is an alias for implementation 'com.google.firebase:firebase-core:16.0.4'



And in your Project level gradle file update



classpath 'com.google.gms:google-services:4.0.1'


To



classpath 'com.google.gms:google-services:4.2.0'





share|improve this answer























  • ,I try this Solution but error still
    – MahrousMansour
    Nov 11 at 18:29










  • set all your firebase dependency version as displayed in this link firebase.google.com/docs/android/setup#available_libraries
    – Mohammed Junaid
    Nov 11 at 19:57










  • And remove com.google.firebase:firebase-crash:16.2.1 as it is deprecated long ago
    – Mohammed Junaid
    Nov 11 at 19:58











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239452%2ferrorprogram-type-already-present-com-google-android-gms-internal-measurement%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













In your app level gradle file downgrade



implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'


to



    implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-functions:16.1.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.firebase:firebase-invites:16.0.4'


Remove implementation 'com.google.firebase:firebase-crash:16.2.1' from your project as it is deprecated.



And Remove implementation 'com.google.firebase:firebase-analytics:16.0.5' as it is an alias for implementation 'com.google.firebase:firebase-core:16.0.4'



And in your Project level gradle file update



classpath 'com.google.gms:google-services:4.0.1'


To



classpath 'com.google.gms:google-services:4.2.0'





share|improve this answer























  • ,I try this Solution but error still
    – MahrousMansour
    Nov 11 at 18:29










  • set all your firebase dependency version as displayed in this link firebase.google.com/docs/android/setup#available_libraries
    – Mohammed Junaid
    Nov 11 at 19:57










  • And remove com.google.firebase:firebase-crash:16.2.1 as it is deprecated long ago
    – Mohammed Junaid
    Nov 11 at 19:58















up vote
0
down vote













In your app level gradle file downgrade



implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'


to



    implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-functions:16.1.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.firebase:firebase-invites:16.0.4'


Remove implementation 'com.google.firebase:firebase-crash:16.2.1' from your project as it is deprecated.



And Remove implementation 'com.google.firebase:firebase-analytics:16.0.5' as it is an alias for implementation 'com.google.firebase:firebase-core:16.0.4'



And in your Project level gradle file update



classpath 'com.google.gms:google-services:4.0.1'


To



classpath 'com.google.gms:google-services:4.2.0'





share|improve this answer























  • ,I try this Solution but error still
    – MahrousMansour
    Nov 11 at 18:29










  • set all your firebase dependency version as displayed in this link firebase.google.com/docs/android/setup#available_libraries
    – Mohammed Junaid
    Nov 11 at 19:57










  • And remove com.google.firebase:firebase-crash:16.2.1 as it is deprecated long ago
    – Mohammed Junaid
    Nov 11 at 19:58













up vote
0
down vote










up vote
0
down vote









In your app level gradle file downgrade



implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'


to



    implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-functions:16.1.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.firebase:firebase-invites:16.0.4'


Remove implementation 'com.google.firebase:firebase-crash:16.2.1' from your project as it is deprecated.



And Remove implementation 'com.google.firebase:firebase-analytics:16.0.5' as it is an alias for implementation 'com.google.firebase:firebase-core:16.0.4'



And in your Project level gradle file update



classpath 'com.google.gms:google-services:4.0.1'


To



classpath 'com.google.gms:google-services:4.2.0'





share|improve this answer














In your app level gradle file downgrade



implementation "com.google.firebase:firebase-core:16.0.5"
implementation "com.google.firebase:firebase-firestore:17.1.3"
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'com.google.firebase:firebase-functions:16.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.google.firebase:firebase-invites:16.0.5'


to



    implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-firestore:17.1.2'
implementation 'com.google.firebase:firebase-database:16.0.4'
implementation 'com.google.firebase:firebase-storage:16.0.4'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-functions:16.1.2'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.firebase:firebase-invites:16.0.4'


Remove implementation 'com.google.firebase:firebase-crash:16.2.1' from your project as it is deprecated.



And Remove implementation 'com.google.firebase:firebase-analytics:16.0.5' as it is an alias for implementation 'com.google.firebase:firebase-core:16.0.4'



And in your Project level gradle file update



classpath 'com.google.gms:google-services:4.0.1'


To



classpath 'com.google.gms:google-services:4.2.0'






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 11 at 20:13

























answered Nov 11 at 12:03









Mohammed Junaid

685713




685713












  • ,I try this Solution but error still
    – MahrousMansour
    Nov 11 at 18:29










  • set all your firebase dependency version as displayed in this link firebase.google.com/docs/android/setup#available_libraries
    – Mohammed Junaid
    Nov 11 at 19:57










  • And remove com.google.firebase:firebase-crash:16.2.1 as it is deprecated long ago
    – Mohammed Junaid
    Nov 11 at 19:58


















  • ,I try this Solution but error still
    – MahrousMansour
    Nov 11 at 18:29










  • set all your firebase dependency version as displayed in this link firebase.google.com/docs/android/setup#available_libraries
    – Mohammed Junaid
    Nov 11 at 19:57










  • And remove com.google.firebase:firebase-crash:16.2.1 as it is deprecated long ago
    – Mohammed Junaid
    Nov 11 at 19:58
















,I try this Solution but error still
– MahrousMansour
Nov 11 at 18:29




,I try this Solution but error still
– MahrousMansour
Nov 11 at 18:29












set all your firebase dependency version as displayed in this link firebase.google.com/docs/android/setup#available_libraries
– Mohammed Junaid
Nov 11 at 19:57




set all your firebase dependency version as displayed in this link firebase.google.com/docs/android/setup#available_libraries
– Mohammed Junaid
Nov 11 at 19:57












And remove com.google.firebase:firebase-crash:16.2.1 as it is deprecated long ago
– Mohammed Junaid
Nov 11 at 19:58




And remove com.google.firebase:firebase-crash:16.2.1 as it is deprecated long ago
– Mohammed Junaid
Nov 11 at 19:58


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239452%2ferrorprogram-type-already-present-com-google-android-gms-internal-measurement%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

Tangent Lines Diagram Along Smooth Curve

Yusuf al-Mu'taman ibn Hud

Zucchini