0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

RealmSwiftでエラー:Thread 1: Fatal error: ‘try!’ expression unexpectedly raised an error: Error Domain=io.realm Code=10 “Migration is required due to the following errors:

Posted at

前提

Realmでデータ構成を書き換えたら、下記のエラーが発生。
スクリーンショット 2022-12-01 20.44.34.png

エラー内容

Realmのデータ構成を書き換えたらマイグレーションという処理をしなければならないよ。
という内容のエラーになります

ですが、アプリリリース前の場合は簡単に対応可能です。

アプリリリースしている場合には、マイグレーション処理が必要となる

対処方法

1.ホーム画面に戻る

スクリーンショット 2022-12-01 20.56.11.png

2.アプリを削除

スクリーンショット 2022-12-01 20.58.46.png

3.Xcodeに戻り再起動する

スクリーンショット 2022-12-01 21.03.44.png

まとめ

アプリリリースしている場合はマイグレーション処理が必要となりますが、
リリース前段階で、上記のエラーが出た場合には簡単に対処可能です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?