blinkinput / blinkinput-ios

OCR SDK for iOS powered by MicroBlink
Apache License 2.0
130 stars 26 forks source link

Crashing right after scanningViewController is presented #25

Closed cjgehinscott closed 6 years ago

cjgehinscott commented 7 years ago

after the scanningViewController is presented I get a hard crash in the OCRProofOfConcept`mb::RecognizerSettingsValidator::validateRecognizerSettingsArray thread.

I have a valid demo license in my portal. Here is my coordinator set up code:

`let rawOcrParserID = "rawOcrParserID" let priceParserID = "priceParserID"

@IBAction func scanTouched(_ sender: UIButton) {

    var error: NSError?

    let coordinator = coordinatorWithError(error: &error)

    if coordinator == nil{
        let alert = UIAlertController(title: "Warning", message: "Scanning not supported", preferredStyle: .alert)
        self.present(alert, animated: true, completion: nil)
    }else{
        let scanningViewController = PPViewControllerFactory.cameraViewController(with: self, coordinator: coordinator!, error: nil)
        self.present(scanningViewController, animated: true, completion: nil)
    }

}
override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

func coordinatorWithError(error: NSErrorPointer) -> PPCameraCoordinator?{
    if PPCameraCoordinator.isScanningUnsupported(for: .back, error: error) == true{
        return nil
    }

    let settings = PPSettings()

    settings.licenseSettings.licenseKey = "<Demo License Key>"

    let ocrRecognizerSettings = PPBlinkOcrRecognizerSettings()

    ocrRecognizerSettings.addOcrParser(PPOcrParserFactory(), name: rawOcrParserID)

    let priceParser = PPPriceOcrParserFactory()
    priceParser.isRequired = false

    ocrRecognizerSettings.addOcrParser(priceParser, name: priceParserID)

    settings.scanSettings.add(ocrRecognizerSettings)

    return PPCameraCoordinator(settings: settings, delegate: nil)
}`
culoi commented 7 years ago

Hi @cjgehinscott

Can you please share log output?

This looks like the license key issue but I will have to check the log to find out more.

Regards,

Ivan

cjgehinscott commented 7 years ago

@culoi OCRProofOfConcept 5-30-17, 8-05 AM.txt

culoi commented 7 years ago

Hi @cjgehinscott

Can you reproduce the crash?

We internally worked on some bugfixes and fix will likely be included in next release.

Regards,

Ivan

cjgehinscott commented 7 years ago

@culoi

Yes I can reproduce the crash every time I try to start the ScanningViewController. Is there an ETA for the next release?

Thanks!

CJ

culoi commented 7 years ago

We will have the ETA for a fix when we have a consistent way of reproducing that issue. So far - we have tried using BlinkOCR-sample from Blinkinput-ios repository - it can perform the OCR without problems.

Can you send us the integration code you're using, or modify the BlinkOCR sample so that it consistently crashes?

cjgehinscott commented 7 years ago

@culoi Here is my ViewController code that has an IBAction to initiate the scanning process. Only thing that should need to be injected into the code is a license key. Using Blink via pods so here is my podfile code:

Podfile.txt

OCRPOCViewController.txt