6

Error: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.


apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.intraday.geeks"
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.android.support:design:26.1.0'
    implementation 'com.google.firebase:firebase-core:15.0.4'
    implementation 'com.google.android.gms:play-services-location:15.0.4'
    implementation 'com.google.firebase:firebase-ads:15.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.firebase:firebase-auth:16.0.0'
    implementation 'com.firebaseui:firebase-ui:0.6.2'
}



apply plugin: 'com.google.gms.google-services'
Zoe
  • 27,060
  • 21
  • 118
  • 148
Jayesh Thakkar
  • 113
  • 2
  • 12

2 Answers2

8

Do you have the classpath 'com.google.gms:google-services:4.0.1'?

It is 4.0.1! I updated it from 4.0.0 to 4.0.1 and it is ok!

If it still doesn't work, you can do this, manually add and not use the plugin

HendrikFrans
  • 193
  • 9
Lotus Yang
  • 91
  • 4
0

There are several problems in your gradle, in general, the issue here is there is an incompatibility. With the latest Google Service version, Firebase an other Google libraries can be used in diferent version with no problem.

  1. Upgrade your gradle: In the Project gradle, upgrade the gradle version

classpath 'com.android.tools.build:gradle:3.1.3'

  1. You will have to updgrade gradle-wrapper.properties file as well

distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

  1. Add in the project gradle the latest Google Services Version:

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

  1. Compile is no longer supported, so change it to implementation

implementation 'com.android.support:design:26.1.0'

  1. Firebase-ui is no longer meant to be added all at once, remove it:

implementation 'com.firebaseui:firebase-ui:0.6.2' (delete that line)

  1. Follow Firebase-ui docs to add the dependency you actually need
cutiko
  • 9,887
  • 3
  • 45
  • 59
  • 3
    Good suggestions @cutiko, but I don't think it's the solution. I have the same problem but I already have Gradle, plugin and libraries updated. I cannot figure out where the problem is. – ARLabs Jun 18 '18 at 10:17