juliuscanute / qr_code_scanner

QR Code Scanner for Flutter
BSD 2-Clause "Simplified" License
1.01k stars 799 forks source link

[BUG] Not able to get the scan data. Also E/FrameEvents(31184): updateAcquireFence: Did not find frame. #565

Open Dileep2896 opened 2 years ago

Dileep2896 commented 2 years ago

Describe the bug After upgrading the QR code is not giving any scan data, Before that I was facing the black screen isue which I solved by using the below method.

void _onQRViewCreated(QRViewController controller) {
    this.controller = controller;
    log("Hello");
    controller.scannedDataStream.listen((scanData) {
      log(scanData.code.toString());
      HapticFeedback.vibrate();
      setState(() {
        result = scanData;
      });
    });
    this.controller!.pauseCamera();
    this.controller!.resumeCamera();
  }

Now it's not returning the scanned data!!!!!!

Flutter information Lastest 3 flutter version

Device (please complete the following information):

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

kristimeculi commented 2 years ago

You have to resume your camera before listening for scanned data.

`void _onQRViewCreated(QRViewController controller) { this.controller = controller;

controller.resumeCamera(); log("Hello"); controller.scannedDataStream.listen((scanData) { log(scanData.code.toString()); HapticFeedback.vibrate(); setState(() { result = scanData; }); }); this.controller!.pauseCamera(); this.controller!.resumeCamera(); }`

The message updateAcquireFence: Did not find frame. isn't something to be worried about. The Android team told us that this is likely a bug in HWUI and doesn't signal an error.