Originally created by @alabash on GitHub (Dec 4, 2018).
Hi!
I'm using your library in several projects and love it. It works great and the problem seems to occur only on new Apple devices which is a mystery for me. And only in development (release build configuration crashes too) while simple Adhoc or Testflight install works fine, like it never happened. I've tested on iPhone XR and iPhone XS Max, they both crash while iPad Air, iPad Air 2 and iPad Mini 2 work as expected. All the devices mentioned above are running under iOS 12.1.
I've isolated crashing code. It is pretty straightforward.
class User: CoreStoreObject {
let userId = Value.Required<Int>("user_id", initial: 0)
let name = Value.Optional<String>("name")
}
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let dataStack = DataStack(
CoreStoreSchema(
modelVersion: "V1",
entities: [
Entity<User>("User")
],
versionLock: [
"User": [0x71f1c9576306cae1, 0x1cc9e7d27b8905bd, 0x90ecdf3454c60c44, 0xe4f0004dd40736de]
]
)
)
do {
try dataStack.addStorageAndWait(SQLiteStore(fileName: "DataStorage.sqlite", localStorageOptions: .recreateStoreOnModelMismatch))
} catch {
print(error.localizedDescription)
}
CoreStore.defaultStack = dataStack
CoreStore.perform(
asynchronous: { transaction in
let user: User = transaction.create(Into<User>())
user.userId .= 1
user.name .= "Core Store"
},
success: { _ in
},
failure: { error in
print(error.localizedDescription)
}
)
}
}
Can you help? :)
Originally created by @alabash on GitHub (Dec 4, 2018).
Hi!
I'm using your library in several projects and love it. It works great and the problem seems to occur only on new Apple devices which is a mystery for me. And only in development (release build configuration crashes too) while simple Adhoc or Testflight install works fine, like it never happened. I've tested on iPhone XR and iPhone XS Max, they both crash while iPad Air, iPad Air 2 and iPad Mini 2 work as expected. All the devices mentioned above are running under iOS 12.1.
I've isolated crashing code. It is pretty straightforward.
```
class User: CoreStoreObject {
let userId = Value.Required<Int>("user_id", initial: 0)
let name = Value.Optional<String>("name")
}
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let dataStack = DataStack(
CoreStoreSchema(
modelVersion: "V1",
entities: [
Entity<User>("User")
],
versionLock: [
"User": [0x71f1c9576306cae1, 0x1cc9e7d27b8905bd, 0x90ecdf3454c60c44, 0xe4f0004dd40736de]
]
)
)
do {
try dataStack.addStorageAndWait(SQLiteStore(fileName: "DataStorage.sqlite", localStorageOptions: .recreateStoreOnModelMismatch))
} catch {
print(error.localizedDescription)
}
CoreStore.defaultStack = dataStack
CoreStore.perform(
asynchronous: { transaction in
let user: User = transaction.create(Into<User>())
user.userId .= 1
user.name .= "Core Store"
},
success: { _ in
},
failure: { error in
print(error.localizedDescription)
}
)
}
}
```

Can you help? :)
There's nothing that particularly stands out in your code and your screenshot so I'm not sure what's going on. By any chance, is your project's SWIFT_REFLECTION_METADATA_LEVEL Build Setting set to anything than All? Also, how are you importing Corestore, by Pod or through Carthage?
@JohnEstropia commented on GitHub (Dec 4, 2018):
There's nothing that particularly stands out in your code and your screenshot so I'm not sure what's going on. By any chance, is your project's `SWIFT_REFLECTION_METADATA_LEVEL` Build Setting set to anything than `All`? Also, how are you importing Corestore, by Pod or through Carthage?
Thanks for the response. No, I didn't change it. Just checked it now it is set to "All". I'm using cocoapods.
@alabash commented on GitHub (Dec 4, 2018):
Thanks for the response. No, I didn't change it. Just checked it now it is set to "All". I'm using cocoapods.
@evilgeniuz I recently bumped the Minimum Deployment Version in the develop branch. Can you try pointing your Pod to that branch and see if the behavior changes? (I am assuming your app is at iOS 10+ as minimum deployment version, though)
@JohnEstropia commented on GitHub (Dec 5, 2018):
@evilgeniuz I recently bumped the Minimum Deployment Version in the `develop` branch. Can you try pointing your Pod to that branch and see if the behavior changes? (I am assuming your app is at `iOS 10+` as minimum deployment version, though)
@JohnEstropia commented on GitHub (Dec 6, 2018):
I've reproduced the issue using the CoreStoreDemo app. It looks like this issue was first in Xcode 10.1: https://github.com/wordpress-mobile/WordPress-iOS/issues/10389
Still investigating...
@evilgeniuz Do you have a released version of the app built with Xcode 10.1? Do you see these crashes there?
@JohnEstropia commented on GitHub (Dec 6, 2018):
@evilgeniuz Do you have a released version of the app built with Xcode 10.1? Do you see these crashes there?
@JohnEstropia commented on GitHub (Dec 10, 2018):
Looks like we'll just have to wait for an update or use Xcode 10.0 for now. Related issues:
https://github.com/realm/realm-cocoa/issues/6013
https://github.com/wordpress-mobile/WordPress-iOS/pull/10400
Have the same issue, only when using a physical device in debugging mode. Even on a iPhone 5s. Thought to just mention it.
@Miggets7 commented on GitHub (Dec 16, 2018):
Have the same issue, only when using a physical device in debugging mode. Even on a iPhone 5s. Thought to just mention it.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @alabash on GitHub (Dec 4, 2018).
Hi!
I'm using your library in several projects and love it. It works great and the problem seems to occur only on new Apple devices which is a mystery for me. And only in development (release build configuration crashes too) while simple Adhoc or Testflight install works fine, like it never happened. I've tested on iPhone XR and iPhone XS Max, they both crash while iPad Air, iPad Air 2 and iPad Mini 2 work as expected. All the devices mentioned above are running under iOS 12.1.
I've isolated crashing code. It is pretty straightforward.
Can you help? :)
@JohnEstropia commented on GitHub (Dec 4, 2018):
There's nothing that particularly stands out in your code and your screenshot so I'm not sure what's going on. By any chance, is your project's
SWIFT_REFLECTION_METADATA_LEVELBuild Setting set to anything thanAll? Also, how are you importing Corestore, by Pod or through Carthage?@alabash commented on GitHub (Dec 4, 2018):
Thanks for the response. No, I didn't change it. Just checked it now it is set to "All". I'm using cocoapods.
@JohnEstropia commented on GitHub (Dec 4, 2018):
Hmm.. Does it happen to the mentioned devices on simulator as well?
@alabash commented on GitHub (Dec 4, 2018):
No, on the simulator it works ok, no crashes.
@JohnEstropia commented on GitHub (Dec 5, 2018):
@evilgeniuz I recently bumped the Minimum Deployment Version in the
developbranch. Can you try pointing your Pod to that branch and see if the behavior changes? (I am assuming your app is atiOS 10+as minimum deployment version, though)@alabash commented on GitHub (Dec 5, 2018):
Unfortunately the same. Gives error on XR and no errors on iPad mini 2.
@JohnEstropia commented on GitHub (Dec 6, 2018):
I've reproduced the issue using the CoreStoreDemo app. It looks like this issue was first in Xcode 10.1: https://github.com/wordpress-mobile/WordPress-iOS/issues/10389
Still investigating...
@JohnEstropia commented on GitHub (Dec 6, 2018):
@evilgeniuz Do you have a released version of the app built with Xcode 10.1? Do you see these crashes there?
@alabash commented on GitHub (Dec 6, 2018):
Yeah, just checked it, crashes in 10.1 and in 10.0 works ok.
@JohnEstropia commented on GitHub (Dec 10, 2018):
Looks like we'll just have to wait for an update or use Xcode 10.0 for now. Related issues:
https://github.com/realm/realm-cocoa/issues/6013
https://github.com/wordpress-mobile/WordPress-iOS/pull/10400
@alabash commented on GitHub (Dec 10, 2018):
Yeah, using 10.0 for now everywhere. ありがとう!
@Miggets7 commented on GitHub (Dec 16, 2018):
Have the same issue, only when using a physical device in debugging mode. Even on a iPhone 5s. Thought to just mention it.