Upgrade to Google Play Services:9.0.0 Error Failed to Resolve: Com.Google.Android.Gms:Play-Services-Measurement:9.0.0

Upgrade to Google Play Services:9.0.0 Error Failed to resolve: com.google.android.gms:play-services-measurement:9.0.0

This was found to fix the problem.

Update your classpath in project level gradle com.google.gms:google-services:2.1.0 to classpath com.google.gms:google-services:3.0.0

How to fix google play service error

One of your dependency is having different version of com.google.android.gms.

Update

Firebase dependencies are having independent versions unlike past. If
you have version conflicts then you can update your
com.google.gms:google-services. and start defining independent
version.

Update com.google.gms:google-services

Go to top (project) level build.gradle and update com.google.gms:google-services to version 4.1.0 or newer if available.

buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.1.0' //< update this
}
}

Update Firebase dependencies to Latest Versions

Firebase dependency versions can be individual. So check Latest Versions.

com.google.firebase:firebase-core:16.0.3    //Analytics
com.google.firebase:firebase-database:16.0.2 //Realtime Database

Orignal Solution (Useful)

Ways to resolve:

  1. Exclude com.google.android.gms from conflicted dependency.
  2. Update that dependency if available.
  3. Change your com.google.android.gms version as conflicted version.

Problem

how to see which dependency is using com.google.android.gms?

1. Solution by command

For Android, use this line

 gradle app:dependencies

or if you have a gradle wrapper:

./gradlew app:dependencies

where app is your project module.

Additionally, if you want to check if something is compile vs. testCompile vs androidTestCompile dependency as well as what is pulling it in:

./gradlew :app:dependencyInsight --configuration compile --dependency <name>
./gradlew :app:dependencyInsight --configuration testCompile --dependency <name>
./gradlew :app:dependencyInsight --configuration androidTestCompile --dependency <name>

2 Use these plugins

Gradle View is an Android Studio plugin that you can install and show dependency hierarchy.
Methods Count is another plugin, it also shows dependency tree.

Error:Failed to resolve: com.google.android.gms:play-services-measurement:9.2.0

In the project level build.gradle file, update dependencies to

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

Failed to resolve: com.google.android.gms:play-services-basement:12.0.1

In android/app/build.gradle add this:

def _ext = rootProject.ext
def _googlePlayServicesVersion = _ext.has('googlePlayServicesVersion') ? _ext.googlePlayServicesVersion : '+'

In android/build.gradle add this:

ext { 
// dependency versions
googlePlayServicesVersion = "+"
}

In general, In next future I recomend to update gradle and SDK in your project

For now you can to try to add maven in android/build.gradle:

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

Failed to resolve: com.google.android.gms:play-services-measurement:9.6.1

Finally, I solved it myself. Here is what I did:

  1. Removed compile 'com.google.android.gms:play-services-measurement:9.6.1' and then compiled the project
  2. It gives missing api_key error because GCM got shifted to Firebase and so the google-services.json file does not work
  3. To fix this, simply update the google-services.json file with the new generated file which uses Cloud messaging from Firebase
  4. After this, I compiled and got another error that @drawable/powered_by_google_dark is missing from the project as I am using Places Autocomplete API. To fix this, add compile 'com.google.android.gms:play-services-places:9.6.0' to dependencies

Failed to resolve: com.google.android.gms:play-services-location:9.6.1

Fixed by manually downloading Play Services as described here and moving into position under the SDK.

:S

#hacking4life



Related Topics



Leave a reply



Submit