CodingWithTashi / simple_barcode_scanner

Simple Barcode Scanner
https://pub.dev/packages/simple_barcode_scanner
MIT License
44 stars 60 forks source link

can not scan #30

Open xzghx opened 1 year ago

xzghx commented 1 year ago

Hi, I want to scan some qrCode in android, I get these messages in console and scanner is not returning anything . I tried on android 4 and 12

W/DynamiteModule(30647): Local module descriptor class for com.google.android.gms.vision.dynamite.barcode not found.
I/DynamiteModule(30647): Considering local module com.google.android.gms.vision.dynamite.barcode:0 and remote module com.google.android.gms.vision.dynamite.barcode:0

I'm calling barcode scanner like this:

 ElevatedButton(
                                onPressed: () async {
                                  var res = await Navigator.push(
                                      context,
                                      MaterialPageRoute(
                                        builder: (context) =>
                                            const SimpleBarcodeScannerPage(
                                              scanType: ScanType.qr,
                                            ),
                                      ));
                                  setState(() {
                                    if (res is String) {
                                      _serialNumber = res;
                                    }
                                  });
                                },
                                child: Text('scan')),
CodingWithTashi commented 1 year ago

should work @xzghx , will check and update, can you post what kind of qr you are scanning, if possible attach the qrcode as well

xzghx commented 1 year ago

Sure, this is my sample qr : qr

iulianxpopa commented 1 year ago

@xzghx did you solve the problem?

xzghx commented 1 year ago

@iulianxpopa no I couldn't scan the code.

CodingWithTashi commented 1 year ago

@iulianxpopa and @xzghx I have tested with below code in android 10 and It is working fine (GIF below).

 ElevatedButton(
              onPressed: () async {
                var res = await Navigator.push(
                    context,
                    MaterialPageRoute(
                      builder: (context) => const SimpleBarcodeScannerPage(
                        scanType: ScanType.qr,
                      ),
                    ));
                setState(() {
                  if (res is String) {
                    result = res;
                  }
                });
              },
              child: const Text('Open qr scanner'),
            ),

Please share us the detail with android/ios version you are testing

xzghx commented 1 year ago

@CodingWithTashi this is some more logs

W/DynamiteModule(15981): Local module descriptor class for com.google.android.gms.vision.barcode not found.
I/DynamiteModule(15981): Considering local module com.google.android.gms.vision.barcode:0 and remote module com.google.android.gms.vision.barcode:0
E/Vision  (15981): Error loading optional module com.google.android.gms.vision.barcode: com.google.android.gms.dynamite.DynamiteModule$LoadingException: No acceptable module found. Local version is 0 and remote version is 0.
W/DynamiteModule(15981): Local module descriptor class for com.google.android.gms.vision.dynamite.barcode not found.
I/DynamiteModule(15981): Considering local module com.google.android.gms.vision.dynamite.barcode:0 and remote module com.google.android.gms.vision.dynamite.barcode:0
W/DynamiteModule(15981): Local module descriptor class for com.google.android.gms.vision.barcode not found.
tomlumachain commented 1 year ago

@xzghx Try checking Google Play Services is installed (install Google Play Store if not)

Google Play Services include Mobile Vision API which is required for com.google.android.gms.vision.barcode