Don't crash
Don't crash
Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x1c0664ef4 __pthread_kill + 8
1 libsystem_pthread.dylib 0x1c0585d1c pthread_kill + 196
2 libsystem_c.dylib 0x1c0515a54 abort + 104
3 libswiftCore.dylib 0x1ce03c9e4 swift::TargetExistentialTypeMetadata
4 libswiftCore.dylib 0x1ce03e574 swift_getWitnessTable + 2128
5 HashPhotos 0x100c700e0 type metadata accessor for List
6 HashPhotos 0x100c6bbac HLAsset.init() (
7 HashPhotos 0x100c6bc24 @objc HLAsset.init() (
When initializing realm, app crashes
final class HLAsset: Object {
@objc dynamic var identifier: String = ""
// other codes
let tags = List<HLTag>() // <= this line caused a crash
}
Realm framework version: ?
3.20.0
Xcode version: ?
11.2
iOS/OSX version: ?
iOS 13
Dependency manager + version: ?
SPM
Try disabling dead code stripping on your app鈥檚 project: DEAD_CODE_STRIPPING = NO
@ydnar Thanks! It's working.
But it was ok until Xcode 11.1 without setting DEAD_CODE_STRIPPING=NO.
Why metadata for List() is not included only when building with iOS 13.2 SDK although List is not dead code?
There鈥檚 a bug in Xcode 11.2 with how it links SPM libraries. Generic superclass symbols are dropped, leading to the crash.
https://bugs.swift.org/plugins/servlet/mobile#issue/SR-11564
@ydnar Thanks for the explanation.
Most helpful comment
Try disabling dead code stripping on your app鈥檚 project: DEAD_CODE_STRIPPING = NO