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 <name>
./gradlew :app:dependencyInsight --configuration testCompile --dependency <name>
./gradlew :app:dependencyInsight --configuration androidTestCompile --dependency <name>
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.
For me i needed to update com.google.android.gms:play-services-base
to version 15.0.1
instead of 15.0.0
.
implementation "com.google.android.gms:play-services-base:15.0.1"
Need to use core library component together with other firebase components:
implementation 'com.google.firebase:firebase-core:16.0.0'
Try this is working for me.
Add this in your build.gradle
end of file
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
With google play service. Version 4.3.0
googleServices.disableVersionCheck = true
Firebase components can now have independent versions (see latest release notes: https://firebase.google.com/support/release-notes/android)
What is likely happening is one of your other dependencies is pulling in multiple versions of your com.google.firebase:* dependencies beyond your explicit dependencies onto
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
You may be able to solve this specific problem by moving your dependency of firebase-messaging to 15.0.2.
Solve the issue by following updates in android project.properties
cordova.system.library.3=com.google.firebase:firebase-core:16.0.0
cordova.system.library.10=com.google.firebase:firebase-messaging:17.0.+
and in android cordova support google service -build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath 'com.google.gms:google-services:4.2.0'
}
ext.postBuildExtras = {
if (project.extensions.findByName('googleServices') == null) {
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
googleServices { disableVersionCheck = true }
}
}
This may help you too.