我使用火力地堡崩潰報告和火力地堡遠程配置「默認FirebaseApp沒有在這個過程中初始化」。兩者的版本是9.8.0。應用在某些設備上崩潰,因爲
在大多數設備安裝工程完美(我也跟着Set up crash reporting)。但是,對於小部分設備(它實際上是最高發生的崩潰),當我嘗試在Application onCreate方法中初始化遠程配置時,它會崩潰。
java.lang.RuntimeException: Unable to create application com.company.application.AppApplication: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.company.application. Make sure to call FirebaseApp.initializeApp(Context) first.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6429)
at android.app.ActivityThread.access$1800(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7329)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.company.application. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.a.d(Unknown Source)
at com.google.firebase.b.a.a(Unknown Source)
at com.company.application.d.a.a(SourceFile:21)
at com.company.application.AppApplication.onCreate(SourceFile:76)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1037)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6426)
... 8 more
可以編輯你的問題,並添加應用程序類的oncreate方法? (我想知道你是否「確保首先調用FirebaseApp.initializeApp(Context)」。) – petey
@petey您不必這麼做 - 請參閱https://firebase.googleblog.com/2016/12/how -does-火力初始化-ON-android.html?M = 1 再說,我這是問題,那麼它就會崩潰所有的時間和不僅在設備上的很小的比例。 –