FirebaseApp not initializing despite FirebaseApp.initializeApp() being called in Application class

后端 未结 8 891
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-11 09:59

I am creating an Android application and I\'m currently trying to implement user authentication using Firebase. As far as I can tell, my app is connected to my Firebase serv

相关标签:
8条回答
  • 2021-01-11 10:47

    I encountered this problem after I deleted and re-cloned my app and forgot to include the google-services.json inside the app module. After I re-added it, the problem went away. Nevertheless, you should init the context inside your custom Application class:

    class MyApplication : Application() {
        override fun onCreate() {
            super.onCreate()
            FirebaseApp.initializeApp(this)
        }
    }
    
    <manifest 
        package="your.app">
    
        <application
            android:name=".MyApplication"
    
    0 讨论(0)
  • 2021-01-11 10:52

    Update 2019 : If you update your Firebase dependencies to latest then you should update Google play services as well.

    During the writing of this answer I had updated all my Firebase libs to 17.0.+ but my Google play service was still pointing at 4.1.0.

    Updating play service version to 4.3.0(Latest) fixed it for me.

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