Realm-cocoa: Crash on when adding new realm object at Xcode 10 Official Release

Created on 19 Sep 2018  路  11Comments  路  Source: realm/realm-cocoa

Questions: I used to save the configuration on start at Realm. It was working at Xcode 9.4.1. But, when I upgraded to Xcode 10, it crash on llvm

Bugs: After converting to Xcode 10

-->

Goals

To work perfectly with Xcode 10 which mean it was working before with Xcode 9.4.1

Expected Results

Crash
screenshot at sep 19 17-05-59
screenshot at sep 19 17-07-14

Steps to Reproduce

It just crash after the data is writing to realm database.

Version of Realm and Tooling

Realm framework version: 3.7.5

Xcode version: 10

iOS/OSX version: 12

Dependency manager + version: Cocoapods

O-Community T-Bug

Most helpful comment

Looks like I've found my issue:

In one of my Realm Objects I've declared a variable public var slug: String? however this is normally ignored, on iOS 9 (built with XCode 10) its not being ignored.

I've just put @objc public dynamic var slug: String? and I can create the realm object again without exceptions.

All 11 comments

same problem here. some of my models is being saved and one of them gets crashed here.

same problem here. some of my models is being saved and one of them gets crashed here.

me too, on Xcode 9 working

Same here, but only when running in Apple Watch series 4 simulator, iOS is working fine with the latest release

There's not much I can do to help you with just a screenshot of a crash.

I'm seeing the same issue but only when running my app on iOS 9.x. 10.x and above is alright.

Looks like I've found my issue:

In one of my Realm Objects I've declared a variable public var slug: String? however this is normally ignored, on iOS 9 (built with XCode 10) its not being ignored.

I've just put @objc public dynamic var slug: String? and I can create the realm object again without exceptions.

@neoplastic Exactly, my problem was solved identically with what you said, but in my case, I had a var var customGroupedBy: String? that shouldn't be read by Realm, it must just be an object property. To solve that I added this property in ignoredProperties function from Realm and this worked flawlessly

Thanks for the additional info; I can now reproduce this.

Looks like this is actually just #5781, and the fix for that (#5783) was incorrect and only worked by coincidence.

Thanks everyone and @tgoyne . Please let me know when this fixes was live and I will close the issue. Right now setting as non-optional is the only way.

This was fixed in https://github.com/realm/realm-cocoa/pull/5934, released in 3.11.0

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ishidakei picture ishidakei  路  3Comments

matteodanelli picture matteodanelli  路  3Comments

jpsim picture jpsim  路  3Comments

carvalho-oak picture carvalho-oak  路  3Comments

BackWorld picture BackWorld  路  3Comments