How to solve Firebase API initialization failure (Android + Firebase)

前端 未结 12 1298
渐次进展
渐次进展 2020-12-29 20:02

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

相关标签:
12条回答
  • 2020-12-29 20:57

    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.

    0 讨论(0)
  • 2020-12-29 21:00

    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

    0 讨论(0)
  • 2020-12-29 21:01

    I met the same error, solved by upgrade firebase-core:

    dependencies {    
        compile 'com.google.firebase:firebase-core:9.0.2'
    }
    
    0 讨论(0)
  • 2020-12-29 21:01

    add compile 'com.google.android.gms:play-services:9.0.0' into your app level build.gradle file

    0 讨论(0)
  • 2020-12-29 21:02

    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

    0 讨论(0)
  • 2020-12-29 21:02

    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.

    0 讨论(0)
提交回复
热议问题