Open Xgamefactory opened 4 years ago
I have same problem with example code:
Attempt to invoke interface method 'void io.flutter.plugin.common.MethodChannel$Result.success(java.lang.Object)' on a null object reference
Actually qrcode value is read into barcodeScanRes but then app crashes
Future<void> scanQR() async {
String barcodeScanRes;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
barcodeScanRes = await FlutterBarcodeScanner.scanBarcode("#ff6666", "Cancel", true, ScanMode.QR);
print(barcodeScanRes);
} on PlatformException {
barcodeScanRes = 'Failed to get platform version.';
}
if (!mounted) return;
setState(() {
_scanBarcode = barcodeScanRes;
});
Using latest version 1.0
Android studio 3.6.3 Runtime version 1.8.0_212 Flutter version 1.12.13+hotfix.9 Emulator Pixel2, API 23
yes latest plugin causes crash. we are switching back to barcode_scan plugin.
Unfortunately also barcode_scan is not working for me https://github.com/mintware-de/flutter_barcode_reader/issues/226#issuecomment-623088525
@Xgamefactory @prokons
Can you provide a sample barcode so I can reproduce this issue?
At last I managed to make barcode_scan running and I used it. Anyway. as a sample, I just used an online generated qrCode with my name.
i have same problem and it happened using your example as test ( i use flutter). the only way to not making crash the app is the streaming barcode , it gets the code but i have to navigate back to my page....there is another way to make it work?
i tried to recreate by my self getBarcodeStreamReceiver
closing at the first code got.
when:
"isContinuousScan": true,
evreything is ok, when i try to change it in :
"isContinuousScan": false,
it crashes
i've just tried using .single or .first instead of .listen but it doesn't quit cam. i need to close at first element. and any way i try it doesn't work. i need it soon as possible
@vglider Allow me some time to reproduce this issue at my end.
Meanwhile, can you provide me some details like which device on which you are facing the issue?
@vglider Allow me some time to reproduce this issue at my end.
Meanwhile, can you provide me some details like which device on which you are facing the issue?
package version 1.0.1
Android Studio 4.0 Build #AI-193.6911.18.40.6514223, built on May 20, 2020 Runtime version: 1.8.0_242-release-1644-b01 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Windows 10 10.0 Huawei MediaPad T5 API from 26 to 29 (Android 8.0 to 10.0)
if you need further details just ask
i build my widget with GestureDetector, wich my onTap function is:
import 'package:flutter_barcode_scanner/flutter_barcode_scanner.dart' as scanner;
function: () { scanner.FlutterBarcodeScanner.getBarcodeStreamReceiver( "#000000", "Cancel", false, scanner.ScanMode.DEFAULT, ).listen( (code) { userQR = code; print(userQR); }, ); },
i tried with another device but stil the same... i used Alcatel 1S (Android 9.0)
@AmolGangadhare have you replicated the issue?
i got this issue too
@AmolGangadhare hi, i just upgrade my flutter version (now is: 1.17.3) and normal scan works...thanks
Please check with v 2.0.0 if the issue still there. Potential fix has been made.
what i try to do is stream barcodes and get only qrcode not standart ean carcodes.
using latest version 1.0