AOSP Firebase initialisation error (FirebaseApp is not initialized in this process com.package.name)

拥有回忆 提交于 2021-02-11 18:06:05

问题


I'm trying to build a custom app into aosp build which uses Firebase database. I've included the firebase database(com.google.firebase.firebase_database) along with all it's compile dependencies in Android.bp and build process is a success. However, when I launch the app, I always get this exception

java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.package.name. Make sure to call FirebaseApp.initializeApp(Context) first.

I have tried calling it in many places or particularly at

class MyApp : Application() {

    override fun onCreate() {
        super.onCreate()

        FirebaseApp.initializeApp(applicationContext)
    }
}

However, when I build the apk in Android studio and side load via adb, my app works just fine and it can talk and receive data from Firebase database.

How do I configure Firebase Database to work outside of gradle build environment?

来源:https://stackoverflow.com/questions/63072643/aosp-firebase-initialisation-error-firebaseapp-is-not-initialized-in-this-proce

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!