Parse.com iOS SDK崩溃:PFSQLiteDatabase.m第178行 - [PFSQLiteDatabase _executeQueryAsync:withArgumentsInArray:cachingEnabled:]

时间:2015-09-28 22:28:57

标签: ios swift parse-platform crash local-datastore

我的应用程序在生产中使用Parse.com iOS SDK和本地数据存储区([PFObject pin])。

我们的一些用户正在将这次崩溃投入生产,正如我们在崩溃线程的Crashlytics报告中看到的那样:

Thread : Crashed: com.parse.sqlite.db.queue
0  libsqlite3.dylib               0x000000019b269f58 (null) + 9096
1  libsqlite3.dylib               0x000000019b25315c (null) + 85124
2  libsqlite3.dylib               0x000000019b25315c (null) + 85124
3  libsqlite3.dylib               0x000000019b21bd68 (null) + 3028
4  libsqlite3.dylib               0x000000019b2530c0 (null) + 84968
5  libsqlite3.dylib               0x000000019b245848 (null) + 29552
6  libsqlite3.dylib               0x000000019b225794 (null) + 13080
7  libsqlite3.dylib               0x000000019b224634 (null) + 8632
8  libsqlite3.dylib               0x000000019b223734 (null) + 4792
9  libsqlite3.dylib               0x000000019b222fa4 (null) + 2856
10 libsqlite3.dylib               0x000000019b222c5c (null) + 2016
11 Parse                          0x00000001009a9c20 -[PFSQLiteDatabase _executeQueryAsync:withArgumentsInArray:cachingEnabled:] (PFSQLiteDatabase.m:178)
12 Bolts                          0x000000010061d034 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke_2 (BFTask.m:334)
13 libdispatch.dylib              0x000000019b5457b0 _dispatch_call_block_and_release + 24
14 libdispatch.dylib              0x000000019b545770 _dispatch_client_callout + 16
15 libdispatch.dylib              0x000000019b55175c _dispatch_queue_drain + 864
16 libdispatch.dylib              0x000000019b549274 _dispatch_queue_invoke + 464
17 libdispatch.dylib              0x000000019b545770 _dispatch_client_callout + 16
18 libdispatch.dylib              0x000000019b553bb0 _dispatch_root_queue_drain + 2140
19 libdispatch.dylib              0x000000019b55334c _dispatch_worker_thread3 + 112
20 libsystem_pthread.dylib        0x000000019b759478 _pthread_wqthread + 1092

我的假设是当数据库架构在应用程序升级之间发生变化时会发生这种情况,但这几乎是纯粹的猜测。

我正在寻找的是通过捕获异常或者通过设置一些SDK配置属性来查看是否有人知道如何防止此崩溃发生。

我们的固定对象仅用于捕获数据和用户会话,如果需要,可以安全删除。

更新:2015年11月23日

在应用程序启动时,我们一直在使用Parse SDK(1.9.1)遇到此问题。看起来当Parse.com后端的数据模型发生变化并且与固定对象的数据模型不同时,应用程序总是崩溃一次。下次运行时,一切正常。

重现的可能步骤(不是100%肯定):

  1. 从Parse.com加载对象
  2. 本地固定对象
  3. 完全关闭应用程序
  4. 通过添加新列
  5. 在Parse.com中更新模型
  6. 启动应用程序
  7. 重复步骤1和2
  8. CRASH
  9. 再次启动该应用程序
  10. 重复步骤1和2
  11. 一切正常
  12. 这是另一个可能有助于调试问题的崩溃报告:

    Thread : Crashed: com.parse.sqlite.db.queue
    0  libsqlite3.dylib               0x19ac05f58 (null) + 9096
    1  libsqlite3.dylib               0x19abdc020 (null) + 6984
    2  libsqlite3.dylib               0x19abdc020 (null) + 6984
    3  libsqlite3.dylib               0x19abdbe2c (null) + 6484
    4  libsqlite3.dylib               0x19abc1cc0 (null) + 14404
    5  libsqlite3.dylib               0x19abc0634 (null) + 8632
    6  libsqlite3.dylib               0x19abbf734 (null) + 4792
    7  libsqlite3.dylib               0x19abbefa4 (null) + 2856
    8  libsqlite3.dylib               0x19abbec5c (null) + 2016
    9  Parse                          0x100de8bc8 -[PFSQLiteDatabase _executeQueryAsync:withArgumentsInArray:cachingEnabled:] (PFSQLiteDatabase.m:176)
    10 Bolts                          0x1006c6fec __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke_2 (BFTask.m:336)
    11 libdispatch.dylib              0x19aee17b0 _dispatch_call_block_and_release + 24
    12 libdispatch.dylib              0x19aee1770 _dispatch_client_callout + 16
    13 libdispatch.dylib              0x19aeed75c _dispatch_queue_drain + 864
    14 libdispatch.dylib              0x19aee5274 _dispatch_queue_invoke + 464
    15 libdispatch.dylib              0x19aee1770 _dispatch_client_callout + 16
    16 libdispatch.dylib              0x19aeefbb0 _dispatch_root_queue_drain + 2140
    17 libdispatch.dylib              0x19aeef34c _dispatch_worker_thread3 + 112
    18 libsystem_pthread.dylib        0x19b0f5478 _pthread_wqthread + 1092
    19 libsystem_pthread.dylib        0x19b0f5028 start_wqthread + 4
    

    另一个:

    Thread : Crashed: com.parse.sqlite.db.queue
    0  libsqlite3.dylib               0x195959bb8 (null) + 31936
    1  libsqlite3.dylib               0x195959bb4 (null) + 31932
    2  libsqlite3.dylib               0x195952108 sqlite3_step + 528
    3  Parse                          0x100e7e330 -[PFSQLiteDatabaseResult step] (PFSQLiteDatabaseResult.m:39)
    4  Parse                          0x100e7e2ec -[PFSQLiteDatabaseResult next] (PFSQLiteDatabaseResult.m:35)
    5  Parse                          0x100e59ce4 __52-[PFOfflineStore _getPointerAsyncWithUUID:database:]_block_invoke (PFOfflineStore.m:897)
    6  Bolts                          0x100727748 __62-[BFTask continueWithExecutor:successBlock:cancellationToken:]_block_invoke (BFTask.m:410)
    7  Bolts                          0x100726fec __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke_2 (BFTask.m:336)
    8  Bolts                          0x100724d5c __29+[BFExecutor defaultExecutor]_block_invoke_2 (BFExecutor.m:45)
    9  Bolts                          0x100725270 -[BFExecutor execute:] (BFExecutor.m:109)
    10 Bolts                          0x100726f64 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke (BFTask.m:328)
    11 Bolts                          0x100726b70 -[BFTask runContinuations] (BFTask.m:308)
    12 Bolts                          0x1007263e0 -[BFTask trySetResult:] (BFTask.m:200)
    13 Bolts                          0x100726314 -[BFTask setResult:] (BFTask.m:187)
    14 Bolts                          0x100727e4c -[BFTaskCompletionSource setResult:] (BFTaskCompletionSource.m:52)
    15 Bolts                          0x1007272ac __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke_3 (BFTask.m:352)
    16 Bolts                          0x1007270a0 __55-[BFTask continueWithExecutor:block:cancellationToken:]_block_invoke_2 (BFTask.m:360)
    17 libdispatch.dylib              0x195c313ac _dispatch_call_block_and_release + 24
    18 libdispatch.dylib              0x195c3136c _dispatch_client_callout + 16
    19 libdispatch.dylib              0x195c3b4c0 _dispatch_queue_drain + 1216
    20 libdispatch.dylib              0x195c34474 _dispatch_queue_invoke + 132
    21 libdispatch.dylib              0x195c3d224 _dispatch_root_queue_drain + 664
    22 libdispatch.dylib              0x195c3e75c _dispatch_worker_thread3 + 108
    23 libsystem_pthread.dylib        0x195e0d2e4 _pthread_wqthread + 816
    24 libsystem_pthread.dylib        0x195e0cfa8 start_wqthread + 4
    

1 个答案:

答案 0 :(得分:0)

更新解析sdk到最新版本并且还避免使用cocapods尝试手动安装它。 Cocca pods像js一样稳定。