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

后端 未结 8 1035
佛祖请我去吃肉
佛祖请我去吃肉 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)
        }
    }
    
    
    
        

提交回复
热议问题