Closed jojost1 closed 3 years ago
Possibly – perhaps set a breakpoint and see what the problem is, then open a PR if you can find a fix.
It also crashes for me at the same place.
2020-08-04 17:07:21.719691-0700 essen[24474:6831321] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSSingleObjectArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(0x19375d654 0x19347fbcc 0x19365a230 0x1a0c0e1e4 0x1a0c11a4c 0x104aa5654 0x104aa57dc 0x1936b9504 0x1936b954c 0x1936b88a4 0x1936b857c 0x1936352d4 0x1936b7edc 0x193a25974 0x1974805c0 0x196fb65f8 0x1973882ac 0x19747d62c 0x196fb652c 0x196fb6430 0x19747d528 0x196fb62c8 0x196e27e30 0x196e269d0 0x196e27b68 0x1973ada08 0x1988e50a8 0x198909684 0x1988eebfc 0x1989095b8 0x1073cf730 0x1073d2bb0 0x19892d850 0x19892d51c 0x1989127cc 0x1988dd790 0x197809f48 0x197854cb4 0x19a1bbc54 0x19a1e54e4 0x19783a9d0 0x1936daf2c 0x1936d5e20 0x1936d629c 0x1936d5ba8 0x19d845344 0x1978113e4 0x1049d3e2c 0x19355d8f0)
libc++abi.dylib: terminating with uncaught exception of type NSException
I don't know how to fix it though. What I did in my code base is to just remove updateOrientation() function.
Ended up switching to this: https://github.com/heart/CarBode-Barcode-Scanner-For-SwiftUI
Seems to be running without crashes & is maintained.
@twostraws It's an array out of bounds crash, since the connections
array is incorrectly accessed:
@objc func updateOrientation() {
guard let orientation = UIApplication.shared.windows.first?.windowScene?.interfaceOrientation else {
return
}
let previewConnection = captureSession.connections[1] // UH OH
previewConnection.videoOrientation = AVCaptureVideoOrientation(rawValue: orientation.rawValue) ?? .portrait
}
However, it's fixed in master. Perhaps consider releasing a new version?
In iOS 14 I have the same problem all the time; I have never see it in iOS 13 (maybe lucky?). However, if it is already fixed in master, a new release would be appreciated.
Same problem in iOS 14.0.1: is this project still active?
This was fixed and just needs a new release: https://github.com/twostraws/CodeScanner/pull/10
This ought to be resolved.
Hi,
I'm noticing some crashes caused when users tap the button that starts the CodeScannerView.
An error log of one of my TestFlight users:
Any idea what's going on? Perhaps something with
@objc CodeScannerView.ScannerViewController.updateOrientation()
?