Comments (6)
Do you know more parameters to the crash? Like which devices are affected or which version of iOS?
Demangled symbol:
function signature specialization of fast_barcode_scanner.BarcodeReader.metadataOutput(_: __C.AVCaptureMetadataOutput, didOutput: Swift.Array<__C.AVMetadataObject>, from: __C.AVCaptureConnection) -> ()
Which is
func metadataOutput(_ output: AVCaptureMetadataOutput,
didOutput metadataObjects: [AVMetadataObject],
from connection: AVCaptureConnection) {
guard
let metadata = metadataObjects.first,
let readableCode = metadata as? AVMetadataMachineReadableCodeObject
else { return }
pauseIfRequired()
codeCallback([flutterMetadataObjectTypes[readableCode.type]!, readableCode.stringValue!])
}
The only possible cause could be the force unwrappings here: [flutterMetadataObjectTypes[readableCode.type]!, readableCode.stringValue!]
.
The first one is really unlikely to have caused the crash, because AVFoundation supports a fixed range of code types which I just copied into flutterMetadataObjectTypes
.
Are there code types that do not have a value?
Anyway I guess it would be good to have both unwrappings in the guard statement as it is in #17.
from fast_barcode_scanner.
I do not know what code types do not have a value. I think you are correct. I have modified the code in my project below and will see if the crash goes away. Do you want me to do a PR, or do you want to make the change?
Thank you for looking into this error.
func metadataOutput(_ output: AVCaptureMetadataOutput,
didOutput metadataObjects: [AVMetadataObject],
from connection: AVCaptureConnection) {
guard
let metadata = metadataObjects.first,
let readableCode = metadata as? AVMetadataMachineReadableCodeObject,
let type = flutterMetadataObjectTypes[readableCode.type],
let value = readableCode.stringValue
else { return }
pauseIfRequired()
codeCallback([type, value])
}
from fast_barcode_scanner.
Did we fix this issue in the develop branch?
Not sure where we left of.
from fast_barcode_scanner.
I did not edit development. I ended up trying this package instead: https://pub.dev/packages/fl_mlkit_scanning. It seems really good, but possibly cpu intensive. I may try your cpu tests to see how it compares to AVFoundation.
from fast_barcode_scanner.
Too bad. The force unwrapping is gone on develop branch, so the bug should not happen on there, if you like to try again!
from fast_barcode_scanner.
Thanks, I will try again. I appreciate you fixing the issues!
from fast_barcode_scanner.
Related Issues (20)
- iOS resume detector
- (2.0.0) allow iOS detection SDK to be configurable
- support OCR scanning HOT 2
- [iOS] Scanner is very bad at detecting horizontal barcodes on arched objects like bottles HOT 3
- Access scanned preview HOT 2
- Landscape mode problems HOT 2
- Camera doesn't work on Android when first built. HOT 3
- Unhandled Exception: PlatformException(NOT_INITIALIZED, Camera has not been initialized, null, null)
- Build failing
- [AVCaptureSession startRunning] should be called from background thread HOT 2
- EXC_BAD_ACCESS crash when app is put into background on iOS HOT 1
- Cannot build example on develop branch
- capture the Image of pauseVideo to File HOT 1
- capture the Image of pauseVideo to File
- Inverse Data Matrix code for Android
- Crash Release Android x86
- Active maintenance? HOT 1
- GS1 DataMatrix codes are not being decoded properly on the IOS 16 and above.
- The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher HOT 2
- app crash issue on denying permission HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast_barcode_scanner.