So i was working on private framework that uses camera (so this framework is tested with a device) and decide to use some KVO. i set the minimum version of iOS to 9 in my project.
when i tried to integrate it with the bigger project, it works fine with device iPhone 8 or above and iOS 12 or above.
But when the project is released to public, i have crashes:
Fatal error: could not demangle keypath type from '10QRIScannerAAC': file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-1001.0.82.4/swift/stdlib/public/core/KeyPath.swift, line 2611
this trace is from crashlytics and i don't have the specific device to investigate by my self
the stack trace is hidden because the project is obfuscated
the crash report show that it only occurs on iphone 5 with ios 10.3.4 installed
the code that used KVO:
class ScannerVideoCapture: NSObject {
@objc dynamic var metaDataStringValues: [String] = []
//Some logic that modify metaDataStringValues.....
}
public final class Scanner: NSObject {
@objc dynamic private var scannerVideoCapture: ScannerVideoCapture
private var scannerValueObserver: NSKeyValueObservation?
// Initialization, setups, etc.......
//MARK: Private Functions
private func registerLocalNotification() {
scannerValueObserver = observe(\.scannerVideoCapture.metaDataStringValues,
options: [.new], changeHandler: {[weak self] object, change in
guard let dataValues = change.newValue else {
return
}
self?.delegate?.didReceiveDataFromCapture(urlStrings: dataValues)
})
}
}
so, is it iOS faulty? or is it the iPhone 5 in specific? or is my implementation just plain wrong?