Today after updating the play services in root folder I\'m facing the following problem . I\'m confused how to fix this.
Can anyone please help me to fix this ?
One of your dependency is having different version of com.google.android.gms
.
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.
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
}
}
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
Ways to resolve:
com.google.android.gms
from conflicted dependency.com.google.android.gms
version as conflicted version.how to see which dependency is using com.google.android.gms
?
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
./gradlew :app:dependencyInsight --configuration testCompile --dependency
./gradlew :app:dependencyInsight --configuration androidTestCompile --dependency
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.