I recently needed to use Google GCM in my project. From its website it is said:
Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits
Well, after struggle a lot I found what was causing my problem. Basically I had two libraries modules - that happened to be of my own - each one of them importing different versions of com.android.support:appcompat-v7.*
and google play services. Made all of them import the same version and problem is gone.
In My case i forgot to add this with in App Level build
implementation 'com.google.firebase:firebase-messaging:9.6.0'
So i got the FireBase firebase-api-initialization-failure
I met the same error, solved by upgrade firebase-core:
dependencies {
compile 'com.google.firebase:firebase-core:9.0.2'
}
add compile 'com.google.android.gms:play-services:9.0.0'
into your app level build.gradle file
I faced the Same Issue, but after some r & d and I came to known the problem was in Gradle i.e,
compile "com.android.support:support-v4:+"
then I just removed the + and replaced actual version ie,
compile "com.android.support:support-v4:23.1.0"
then it started working
You can check the dependencies with gradle command
./gradlew app:dependencies
As Edgar said ensure that all the dependency libraries has same version. If not then you can exclude that dependency using
compile('your dependency') {
exclude group: 'lib to be removed'
}
And add that dependency yourself.