仅在设备领域迅速迁移崩溃

问题描述 投票:0回答:1

我通过对对象之一添加字段更新我的境界架构。

下面是迁移代码:

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    let config = Realm.Configuration(
        schemaVersion: 4,

        migrationBlock: { migration, oldSchemaVersion in
            if (oldSchemaVersion < 4) {
                print("Updating Realm schema...")
                // Nothing to do!
            }
    })
    Realm.Configuration.defaultConfiguration = config
    let realm = try! Realm()

    // ... rest of code
}
  • 在模拟器上运行时,这是确定
  • 在Xcode的设备上运行时,这是确定

但是,如果我安装从TestFairy或TestFlight的应用程序,该应用程序发布之时崩溃。当我删除迁移一切都很好,因此迁移导致的问题。

Symbolicating崩溃报告不帮忙,飞机坠毁在didFinishLaunchingWithOptions的开始。

尝试了各种导出选项的变化(位码,...),但同样的结果。

你看不到任何理由为什么当更新的应用程序无法在Xcode安装迁移可能会失败?

ios swift realm realm-migration
1个回答
1
投票

每次应用程序分发到飞行测试或在AppStore,

如果您的应用程序最新构建你应该添加一个方案,例如 有4的模式号的试飞新的版本应该是5如果你有境界类的任何更改但是如果您是在本地尝试测试的东西出来,你可以删除该应用程序,并通过Xcode重新安装。

看看在documentation

© www.soinside.com 2019 - 2024. All rights reserved.