LoginSignup
8
4

More than 3 years have passed since last update.

Xcode11, iOS13でビルドしたらRealmのエラーが出た

Posted at

Xcode11にアップデートしたらRealmエラーが発生

エラー内容抜粋
'Primary key property 'id' does not exist on object 'Site''

pod 'RealmSwift', '~> 3.18.0'をしよう

Realm3.12.0だったので最新の3.18.0にしたら解決!

下記に解決策がありました。
https://stackoverflow.com/questions/48810421/rlmexception-primary-key-property-serial-does-not-exist-on-object-book-mig

必ずしも移行に関するものではありませんが、iOS 13およびXcode 11にはこの問題を引き起こす可能性のある問題があります。デフォルトString値が設定されたレルムクラスのすべての文字列プロパティは、何らかの形で無視されます。これを修正するには、最新バージョン(現在は3.18.0)に更新するか、Xcode:Product-> Clean Build Folderを使用します。

ココアポッドを使用している場合、これを行います:

プロジェクトのPodfileを開き、RealmSwift行(あればRealm行も)を次のように置き換えます。

pod 'RealmSwift', '~> 3.18.0'
次に、プロジェクトのフォルダーでターミナルを開き、以下を実行します。

pod repo update
pod install
お役に立てば幸いです。

8
4
1

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
8
4