问题
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