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 version4.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:
- Exclude
com.google.android.gms
from conflicted dependency. - Update that dependency if available.
- 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:
- Removed
compile 'com.google.android.gms:play-services-measurement:9.6.1'
and then compiled the project - It gives
missing api_key error
becauseGCM
got shifted toFirebase
and so thegoogle-services.json
file does not work - To fix this, simply update the
google-services.json
file with the new generated file which uses Cloud messaging from Firebase - 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, addcompile '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
Google Glass Gdk: How to Communicate with Android Device
Getintent() Extras Always Null
Android Studio Stuck on "Gradle: Resolve Dependencies '_Debugcompile'" or 'Detachedconfiguration1'
Error:Cause: Unable to Find Valid Certification Path to Requested Target
Android: Determine Active Input Method from Code
How to Automate the Android Sdk Installation
What Do Gc_For_Malloc, Gc_Explicit, and Other Gc_* Mean in Android Logcat
Action_View Intent for a File with Unknown Mimetype
Does the Android Art Runtime Have the Same Method Limit Limitations as Dalvik
How to Get the Current Location in Google Maps Android API V2
Passing Touch Events to the Parent View
Datepicker Shows Wrong Value of Month
Videoview Getdrawingcache Is Returning Black
What Does It Mean to Inflate a View from an Xml File
How to Set Text Size of Textview Dynamically for Different Screens
Android Contacts Display Name and Phone Number(S) in Single Database Query