Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle sync fails - play-services-measurement-base

I have a problem on my Android project, I can't build, this is the error I have:

Failed to notify dependency resolution listener. The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.2,15.0.2], [15.0.4,15.0.4]], but resolves to 15.0.4. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

I tried many different solution I found but the problem persists. I have the right dependencies and repositories on gradle file on project root:

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
    classpath 'com.google.gms:google-services:4.0.1'
}

and

repositories {
    jcenter()
    mavenLocal()
    mavenCentral()
    maven {
        url "https://maven.google.com"
    }
}

On my app gradle I have the following dependencies:

implementation "com.google.android.gms:play-services-maps:15.0.1"
implementation "com.google.android.gms:play-services-places:15.0.1"
implementation "com.google.android.gms:play-services-gcm:15.0.1"
implementation "com.google.android.gms:play-services-location:15.0.1"
implementation "com.google.android.gms:play-services-analytics:15.0.2"
implementation "com.google.android.gms:play-services-auth:15.0.1"
implementation "com.google.android.gms:play-services-tagmanager:15.0.2"
implementation "com.google.firebase:firebase-core:16.0.0"

Some suggestions?

The solution was update the following dependencies:

implementation "com.google.android.gms:play-services-analytics:16.0.0"
implementation "com.google.android.gms:play-services-tagmanager:16.0.0"
like image 426
Giorgio Provenzale Avatar asked May 28 '18 15:05

Giorgio Provenzale


3 Answers

I just added right after the apply plugin: 'com.google.gms.google-services' at the bottom of my build.gradle :

apply plugin: 'com.google.gms.google-services'
// Work around
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
like image 144
Dima Kozhevin Avatar answered Nov 18 '22 12:11

Dima Kozhevin


I had the same exact error, upgrading analytics was the key:

implementation 'com.google.android.gms:play-services-analytics:16.0.0'

I know you thought everything is updated referring to the official website, but writing 15.0.0 and looking for suggestions works better.

like image 20
Hamzeh Soboh Avatar answered Nov 18 '22 11:11

Hamzeh Soboh


Update project gradle play service dependency with latest release :

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

and

Update project firebase products usage as per firebase latest release note

like image 6
Gautam Dev Avatar answered Nov 18 '22 10:11

Gautam Dev