我的应用会在我onCreate
课程初始化时Firebase.java
强制关闭。
这是Firebase.java
类的构造函数。
public Firebase(Context context, ProgressChecker progressChecker) {
db = FirebaseFirestore.getInstance();
FirebaseFirestoreSettings settings = new FirebaseFirestoreSettings.Builder()
.setTimestampsInSnapshotsEnabled(true)
.build();
db.setFirestoreSettings(settings);
batch = db.batch();
}
这是我从Crashlytics获得的堆栈跟踪。
E/AndroidRuntime: FATAL EXCEPTION: main
Process: julio.ai.moyela.tito.timetoolay, PID: 4740
java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev).
at ecb.b(SourceFile:324)
at ece.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.ExceptionInInitializerError
at esr.<clinit>(SourceFile:82)
at evl.b(SourceFile:103)
at evm.b(SourceFile:46)
at evm.a(SourceFile:26)
at ese.a(SourceFile:70)
at ebh.<init>(SourceFile:88)
at dwp.a(SourceFile:1217)
at dwr.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at ecb$a.run(SourceFile:190)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Package.getImplementationVersion()' on a null object reference
at etx.b(SourceFile:742)
at etx.<clinit>(SourceFile:197)
at esr.<clinit>(SourceFile:82)
at evl.b(SourceFile:103)
at evm.b(SourceFile:46)
at evm.a(SourceFile:26)
at ese.a(SourceFile:70)
at ebh.<init>(SourceFile:88)
at dwp.a(SourceFile:1217)
at dwr.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at ecb$a.run(SourceFile:190)
at java.lang.Thread.run(Thread.java:761)
老实说,我不知道还包括什么,因为这是一个运行时错误。它只发生在我的发布版本中,当我摆脱Firestore初始化时它就会停止发生。
我也在运行这些firebase库。
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-invites:16.0.0'
implementation 'com.google.firebase:firebase-firestore:17.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.3'