我正在使用 Firebase 崩溃报告和 Firebase 远程配置。两者的版本都是 9.8.0。
在大多数设备上,设置都可以完美运行(我遵循了设置崩溃报告)。但是在一小部分设备上(实际上是发生率最高的崩溃),当我尝试在 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