【问题标题】:iOS 10 Core Data Exception Code error: (6922)iOS 10 核心数据异常代码错误:(6922)
【发布时间】:2017-07-07 14:17:29
【问题描述】:

我们在尝试在 iOS 10 上迁移 Core Data 时遇到 SQL 数据库异常。抛出了异常,但迁移似乎仍然成功。我们进行手动迁移,然后 MagicalRecord 处理其余的设置。有没有其他人经历过这个/知道如何解决这个问题?

错误输出:

    CoreData: error: (6922) I/O error for database at /var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite.  SQLite error code:6922, 'disk I/O error'
CoreData: error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite options:{
NSInferMappingModelAutomaticallyOption = 1;
NSMigratePersistentStoresAutomaticallyOption = 1;
NSSQLitePragmasOption =     {
    "journal_mode" = WAL;
};
} ... returned error Error Domain=NSCocoaErrorDomain Code=256 "The file couldn't be opened." UserInfo={NSSQLiteErrorDomain=6922, NSUnderlyingException=I/O error for database at /var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite.  SQLite error code:6922, 'disk I/O error'} with userInfo dictionary {
NSSQLiteErrorDomain = 6922;
NSUnderlyingException = "I/O error for database at /var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite.  SQLite error code:6922, 'disk I/O error'";
}
CoreData: error: Illegal attempt to save to a file that was never opened.  "This NSPersistentStoreCoordinator has no persistent stores (I/O error).  It cannot perform a save operation.".  Last recorded error = Error Domain=NSCocoaErrorDomain Code=256 "The file "Messaging.sqlite" couldn't be opened." UserInfo={NSFilePath=/var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite, NSSQLiteErrorDomain=6922} / {
NSFilePath = "/var/mobile/Containers/Data/Application/9CA333FB-49CB-4168-B26A-A6F6E6CF94C7/Documents/Messaging.sqlite";
NSSQLiteErrorDomain = 6922;
}

【问题讨论】:

  • 您能解决问题吗?你能看看我提出的解决方案吗?

标签: ios sqlite core-data swift3 core-data-migration


【解决方案1】:

我今天升级到 Xcode 11 beta 5 后遇到了这个问题。

运行命令重置我的所有模拟器为我纠正了它:

xcrun simctl erase all

【讨论】:

  • @Karaban 关于我的经验,这可能与模拟器更改有关,因为还有其他相关问题。未对应用进行任何更改以解释不兼容问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-11-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多