2

How to this i am new on Android Studio.

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. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

3 Answers3

2

As reported here:

You will need to update the version of the latter dependency to 15.0.2. 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...

Then update your google play services plugin to 3.3.0

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

and update the dependencies to 15.0.2.

Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
  • doesn't work with this update. The current version of play services is at 3.3.1 which i use. Then in my app gradle file, i use version 15.0.0 for all the google APIs which is what i see here: https://developers.google.com/android/guides/setup . It still doesn't solve the problem. Problem persists – Akah May 09 '18 at 02:04
  • It is not correct and as described you have to use at least the 15.0.2. Check here in the maven google repo. Also google play services libs have the 15.0.2:https://dl.google.com/dl/android/maven2/index.html (in particolar com.google.android.gms:play-services-analytics com.google.android.gms:play-services-appinvite com.google.android.gms:play-services-tagmanager) – Gabriele Mariotti May 09 '18 at 05:29
  • I solved this problem by specifying the actual versions of the firebase dependency i was using in my application since some dependencies no longer share the same version number. If you use the recent play services, then you need to specify each dependency version in your gradle file, especially if you use firebase. – Akah May 17 '18 at 03:49
  • I was getting: The library com.google.android.gms:play-services-ads-lite is being requested by various other libraries at [[17.1.1,17.1.1]], but resolves to 11.4.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies. In my case, updating from com.google.gms:google-services:4.1.0 to com.google.gms:google-services:4.2.0 solved the issue. Good luck! :D – droid256 Nov 28 '18 at 03:47
1

Resolve this issue with me - If You are choosing Firestore Database then do this: first We will add updated these things in Gradle :

buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
    }
}

allprojects {
    // ...
    repositories {
        // ...
        maven {
            url "https://maven.google.com" // Google's Maven repository
        }
    }
}

after this update :

apply plugin: 'com.android.application'

android {
  // ...
}

dependencies {
  // ...
  implementation 'com.google.firebase:firebase-core:16.0.0'

  // Getting a "Could not find" error? Make sure you have
  // added the Google maven respository to your root build.gradle
}

// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'

Then Rebuild or Sunc Now , issue will be resolve.

if You are working on RealTime Database then do this thing :-

Set Dependency :

implementation 'com.google.firebase:firebase-database:15.0.0'

and remove above FireStore Dependency.

This will sure resolve your issue ... If you like then vote for me

Pradeep Sheoran
  • 493
  • 6
  • 15
  • same, not working. the cause of the issue is `apply plugin: 'com.google.gms.google-services'` for me. – Ren Apr 03 '19 at 20:27
0
buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
    }
}

This works for me. By adding the latest version, i.e 4.0.1

Eben Watts
  • 141
  • 6