Android 尝试获取集合时发生firestore崩溃运行时异常
我正在尝试从firestore获取集合。我收到以下错误Android 尝试获取集合时发生firestore崩溃运行时异常,android,firebase,google-cloud-firestore,Android,Firebase,Google Cloud Firestore,我正在尝试从firestore获取集合。我收到以下错误 java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev). at com.google.firebase.firestore.g.zza.zzb(SourceFile:324) at com.google.firebase.firestore.g.zzd.run(Unknown Source) at android.
java.lang.RuntimeException: Internal error in Firestore (0.6.6-dev).
at com.google.firebase.firestore.g.zza.zzb(SourceFile:324)
at com.google.firebase.firestore.g.zzd.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5834)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Caused by: java.lang.AssertionError: INTERNAL ASSERTION FAILED: Only one thread may be created in an AsyncQueue.
at com.google.a.a.a.a.zza.zza(SourceFile:2032)
at com.google.a.a.a.a.zza.zza(SourceFile:2017)
at com.google.firebase.firestore.g.zza$zza.newThread(SourceFile:195)
at java.util.concurrent.ThreadPoolExecutor$Worker.<init>(ThreadPoolExecutor.java:582)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:988)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at com.google.firebase.firestore.g.zza$zza.run(SourceFile:191)
at java.lang.Thread.run(Thread.java:820)
首先,尝试清除设备上应用程序管理器中的数据,然后再次运行应用程序。如果不以这种方式工作,请尝试将以下代码行添加到progauard规则中:
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
尝试将
-keep class io.grpc.*{*}
添加到proguard配置中。它应该会起作用。就我而言,它起了作用。如果没有,请添加你的build.gradle
文件。我重新安装了应用程序,它现在可以工作了。似乎只有在我尝试调试应用程序时才会发生。我的回答对你有帮助吗?它仍然不工作,但只在调试模式下发生
db.collection("mycollection").get().addOnCompleteListener
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}