Program type already present: com.google.android.gms.internal.zzfq

≯℡__Kan透↙ 提交于 2019-11-29 05:29:18

I fix the same issue in my project - after updating the Kotlin plugin to 1.2.41 (I don't know if it is really related. Edit: apparently this is not related with Kotlin) - with :

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

https://developers.google.com/android/guides/google-services-plugin

Remark: I could stay with the unique 15.0.0 Google Play Services libraries version but not the play-services-tagmanager one and firebase :

implementation "com.google.android.gms:play-services-tagmanager:15.0.2"
implementation "com.google.firebase:firebase-core:15.0.2"

The project is compiling now.

Tonny Anthony
  1. set implementation 'com.google.firebase:firebase-messaging:15.0.2' at the app level build.gradle file, if you are using firebase
  2. set classpath 'com.google.gms:google-services:3.2.0' at the project level build.gradle file

Then sync the build.gradle files

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

and

//Firebase
implementation 'com.google.firebase:firebase-core:15.0.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.firebase:firebase-database:15.0.1'

I started seeing this after I upgraded to kotlin plugin version : 1.2.41-release-Studio3.1-1.

Upgrading firebase-core and firebase-messaging from 15.0.0 --> 15.0.2. Fixed the problem, database, auth and gms-auth-services are at 15.0.0

Josue Amador

I fixed the issue using new firebase independent version numbers https://firebase.google.com/support/release-notes/android#latest_sdk_versions

SDK Update - May 2, 2018 -> Firebase Android SDKs now have independent version numbers, allowing for more frequent, flexible updates.

You will need to update the version of the individual libraries. This addresses the issue where version 3.3.0 of the Google Services Gradle plugin reports: The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.0,15.0.0], [15.0.2,15.0.2]], but resolves to 15.0.2...

For more info regarding the latest update check release updates from below link Firebase May 2nd release notes

I had the same error and I fixed it updating lines below:

build.grade (Project: [project_name])

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

build.grade (Module: app)

implementation 'com.firebaseui:firebase-ui-auth:3.3.1'

I hope it helps.

This is very boring. Google should review these updates better. I tried everything, but my issue was only fixed by returning the version of the Google Play Services APIs:

implementation 'com.google.android.gms:play-services-gcm:11.8.0'

Go to the folllowing link : https://firebase.google.com/support/release-notes/android and check for the latest firebase dependencies with the current compatible google play service version as shown in the screenshot below.

I had the same exact error. I was using

    implementation 'com.firebaseui:firebase-ui-auth:3.2.2'

I solved it updating to

    implementation 'com.firebaseui:firebase-ui-auth:3.3.0'

Another possible cause/fix might be the build.gradle at project level

buildscript {

repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'
    classpath 'com.google.gms:google-services:3.2.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

For me the problem was

dependencies {
       classpath 'com.google.firebase:firebase-plugins:1.1.5'
}

used for Performance Monitoring. Just commented out.

I had the same issue, the thing which is causing this error is 2 versions of same dependency with different services

I changed this:

implementation 'com.google.android.gms:play-services-ads:17.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.5'

To:

implementation 'com.google.android.gms:play-services-ads:17.1.1'

these versions are importing same subpackages which is why it is a ambiguity error basically same subpackage is imported from 2 different dependencies (in background)

Have fun coding!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!