juliuscanute / qr_code_scanner

QR Code Scanner for Flutter
BSD 2-Clause "Simplified" License
999 stars 759 forks source link

[BUG] just black screen , no camera view is visible? #560

Open harryandroiddev opened 2 years ago

harryandroiddev commented 2 years ago

after uddating to new version it does not show the camera screen just show the black screen , earlier it was working fine.

wutsi commented 2 years ago

Im having the same problem

edsulaiman commented 2 years ago

workaround for this issue is by pausing and then resuming the camera

void onQRViewCreated(QRViewController controller) {
    qrController = controller;
    qrController.scannedDataStream.listen(onScanned);

    qrController.pauseCamera();
    qrController.resumeCamera();
  }
lockiechen commented 2 years ago

same problem

lockiechen commented 2 years ago

workaround for this issue is by pausing and then resuming the camera

void onQRViewCreated(QRViewController controller) {
    qrController = controller;
    qrController.scannedDataStream.listen(onScanned);

    qrController.pauseCamera();
    qrController.resumeCamera();
  }

with your solution, only debug mode can scan qrcode

hamidjalili59 commented 2 years ago

workaround for this issue is by pausing and then resuming the camera

void onQRViewCreated(QRViewController controller) {
    qrController = controller;
    qrController.scannedDataStream.listen(onScanned);

    qrController.pauseCamera();
    qrController.resumeCamera();
  }

Thanks for the correct answer

dhanrajVerma commented 2 years ago

Facing exactly same issue with log W/Gralloc3(23725): allocator 3.x is not supported

Dileep2896 commented 2 years ago

workaround for this issue is by pausing and then resuming the camera

void onQRViewCreated(QRViewController controller) {
    qrController = controller;
    qrController.scannedDataStream.listen(onScanned);

    qrController.pauseCamera();
    qrController.resumeCamera();
  }

But not able to get the scanned results!!! :(

FlorinAdrianLaudat commented 2 years ago

Same for me (device One Nord Plus) - used the library example. My workaround was to use a resumeCamera outside of the listen.
_onQRViewCreated(QRViewController controller) { _qrController = controller; _qrController.resumeCamera(); controller.scannedDataStream.listen((scanData) {

abs0 commented 2 years ago

Just another confirmation that on Android adding controller.resumeCamera() before listen in _onQRViewCreated(QRViewController controller) fixed the issue

jt274 commented 2 years ago

Same issue. Strangely, if I tap the camera view then it loads.

NAME-NikhilPatil commented 1 year ago

Thank you

ne3Vubeki commented 1 year ago

Better wrap everything in if:

if (Platform.isAndroid) { this.controller?.resumeCamera(); }

Otherwise, on iOS there will be errors:

CameraException(404, No barcode scanner found)

chituanh commented 1 year ago

workaround for this issue is by pausing and then resuming the camera

void onQRViewCreated(QRViewController controller) {
    qrController = controller;
    qrController.scannedDataStream.listen(onScanned);

    qrController.pauseCamera();
    qrController.resumeCamera();
  }

I tried. and it only works when running debug and when reselase, the application is cracked