在 playstore (SQLiteConnection.java) 上启动后,我的 Flutter 应用程序在多个设备上崩溃
Posted
技术标签:
【中文标题】在 playstore (SQLiteConnection.java) 上启动后,我的 Flutter 应用程序在多个设备上崩溃【英文标题】:My Flutter App is Crashing on several devices after launching on playstore (SQLiteConnection.java) 【发布时间】:2021-10-02 03:43:17 【问题描述】:我在 Play 商店中启动了一个应用程序,但它在多台设备上崩溃了,我无法在每台设备上测试我的应用程序。我有 crashlytics 报告
Crashlytics 报告
堆栈跟踪
Fatal Exception: java.lang.RuntimeException: Internal error in Cloud Firestore (23.0.1).
at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$3(AsyncQueue.java:19)
at com.google.firebase.firestore.util.-$$Lambda$AsyncQueue$jx84dqgUsF4ojecSMurRqFLFD1Y.run(-.java:2)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:233)
at android.app.ActivityThread.main(ActivityThread.java:7225)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:499)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:962)
Caused by java.lang.RuntimeException: android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5 SQLITE_BUSY)
at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor.lambda$executeAndReportResult$1(AsyncQueue.java:14)
at com.google.firebase.firestore.util.-$$Lambda$AsyncQueue$SynchronizedShutdownAwareExecutor$pKSAgg-ozJ8RbUveSl-44aUfFQw.run(-.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:15)
at java.lang.Thread.run(Thread.java:764)
Caused by android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5 SQLITE_BUSY)
at android.database.sqlite.SQLiteConnection.nativeExecute(SQLiteConnection.java)
at android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:578)
at android.database.sqlite.SQLiteSession.beginTransactionUnchecked(SQLiteSession.java:323)
at android.database.sqlite.SQLiteSession.beginTransaction(SQLiteSession.java:298)
at android.database.sqlite.SQLiteDatabase.beginTransaction(SQLiteDatabase.java:553)
at android.database.sqlite.SQLiteDatabase.beginTransactionWithListener(SQLiteDatabase.java:517)
at com.google.firebase.firestore.local.SQLitePersistence.runTransaction(SQLitePersistence.java:17)
at com.google.firebase.firestore.local.LocalStore.startMutationQueue(LocalStore.java:9)
at com.google.firebase.firestore.local.LocalStore.start(LocalStore.java)
at com.google.firebase.firestore.core.ComponentProvider.initialize(ComponentProvider.java:41)
at com.google.firebase.firestore.core.FirestoreClient.initialize(FirestoreClient.java:65)
at com.google.firebase.firestore.core.FirestoreClient.lambda$new$0(FirestoreClient.java:10)
at com.google.firebase.firestore.core.FirestoreClient.lambda$new$0$FirestoreClient(FirestoreClient.java)
at com.google.firebase.firestore.core.-$$Lambda$FirestoreClient$Eq-cAcb1C1mM4tyiJsLJXZ13tyU.run(-.java:8)
at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$2(AsyncQueue.java)
at com.google.firebase.firestore.util.-$$Lambda$AsyncQueue$Y9GO7zO2DX6MzQJ5TbKtKW_NzO0.call(-.java:2)
at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor.lambda$executeAndReportResult$1(AsyncQueue.java)
at com.google.firebase.firestore.util.-$$Lambda$AsyncQueue$SynchronizedShutdownAwareExecutor$pKSAgg-ozJ8RbUveSl-44aUfFQw.run(-.java:4)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:15)
at java.lang.Thread.run(Thread.java:764)
设备信息
Brand:OPPO
Model:
Orientation: Portrait
RAM free: 3.28 GB
Disk free: 95.39 GB
Date: 26-07-2021
操作系统
Version:9
Orientation: Portrait
Rooted:No
其他有同样问题的设备
Oppo: F17 Pro,CPH1853
Realme: 5i,c12,8pro
vivo: 1920,1803
【问题讨论】:
嗨,您能找到导致此崩溃的原因吗?我在 android 上看到很多崩溃。 这能回答你的问题吗? My Flutter App is Crashing on several devices after launching on playstore 【参考方案1】:我对此的看法是,一个 sqlite 查询正在一个 sqlite 连接上执行,该连接已经基于它正在执行线程后台工作程序这一事实来处理查询。该系统上的系统 sqlite 可能会以不同方式编译,例如处于单线程模式
原因似乎是 firebase 库及其运行方式,如果这是系统问题(oppo 上的 android 和提供的 sqlite),那么您可能必须检测它是如何编译的或捆绑一个版本的 sqlite解决这个问题
应该可以通过sql连接转储sqlite的编译选项并将其与knwn进行比较
【讨论】:
以上是关于在 playstore (SQLiteConnection.java) 上启动后,我的 Flutter 应用程序在多个设备上崩溃的主要内容,如果未能解决你的问题,请参考以下文章
在 Playstore 中上传 APK 时如何修复“无 JAR 签名”?
我们如何在 ionic 3 应用程序中获取 playstore 应用程序版本?