mlkit icon indicating copy to clipboard operation
mlkit copied to clipboard

Read images from the gallery, this particular QR always fails to read Data

Open nssoftengineer opened this issue 3 years ago • 0 comments

I am also facing the same problem with one of the QR images. During scanning, it is working fine but during images from the gallery, this particular QR always fails. Other QR I am able to read data but this particular QR not working.

sharing QR and dependencies below: failureQR

// Barcode model dependencies implementation 'com.google.mlkit:barcode-scanning:17.0.1'

getting this log only

D/TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning... D/TransportRuntime.SQLiteEventStore: Storing event with priority=DEFAULT, name=FIREBASE_ML_SDK for destination cct D/TransportRuntime.JobInfoScheduler: Upload for context TransportContext(cct, DEFAULT, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning... V/FA: Connecting to remote service V/FA: Connection attempt already in progress D/FA: Connected to remote service V/FA: Processing queued up service tasks: 2

`.addOnSuccessListener(barcodes -> {
                            for (Barcode barcode : barcodes) {
                                Log.d(TAG, "onSuccess: " + barcode.getRawValue());
                                if (barcode.getRawValue() != null) {
                                    isQrSuccess = true;
                                    handleResult(barcode.getRawValue());
                                } else {
                                    dealWithQRScanFailure();
                                }
                            }
                        })
                        .addOnFailureListener(new OnFailureListener() {
                            @Override
                            public void onFailure(@NonNull Exception e) {
                                Log.d(TAG, "onFailure: ");

                            }
                        }).addOnCompleteListener(new OnCompleteListener<List<Barcode>>() {
                            @Override
                            public void onComplete(@NonNull Task<List<Barcode>> task) {
                                Log.d(TAG, "onComplete: ");
                                if (!isQrSuccess) {
                                    dealWithQRScanFailure();
                                }
                            }
                        });`

addOnCompleteListener only getting onComplete block executing others success or failure block not executing.

nssoftengineer avatar Feb 18 '22 07:02 nssoftengineer