twostraws / CodeScanner

A SwiftUI view that is able to scan barcodes, QR codes, and more, and send back what was found.
MIT License
1.01k stars 286 forks source link

Simulator not working with barcodes #63

Closed nikitaskobelkin closed 2 years ago

nikitaskobelkin commented 2 years ago
  1. Open scan on the simulator (Xcode)
  2. Scan from photo
  3. Choose barcode (for example code128 and etc.)
  4. Failure response

But on the real device is ok.

kassi commented 2 years ago

Same issue for me with QR codes.

I'm using it in the HotProspects project from the course and it is unable to scan the images it has saved. Output is:

HotProspects[28896:3017418] Cannot find executable for CFBundle 0x12a372bb0 </System/Library/PrivateFrameworks/Quagga.framework> (not loaded)
Unable to load Quagga from /System/Library/PrivateFrameworks/Quagga.framework
Scanning failed: The operation couldn’t be completed. (CodeScanner.ScanError error 2.)

Seems like restarting the simulator "resolves" this issue.

nathanfallet commented 2 years ago

@nikitaskobelkin @kassi Is the bug still present in the latest version?

kassi commented 2 years ago

@nikitaskobelkin just tried again and can't reproduce. As I wrote already, restarting the simulator helped. Didn't have the problem this time.

nathanfallet commented 2 years ago

Well, closing as the issue is not here anymore for now. If it occurs again, please reopen.

Also note that simulator scanning is not done the same way as real scanning from camera: https://github.com/twostraws/CodeScanner/blob/9aef09bf5c0274689a89c2fd71794011bebdc43f/Sources/CodeScanner/ScannerViewController.swift#L58