mintware-de / flutter_barcode_reader

A flutter plugin for reading 2D barcodes and QR codes.
MIT License
628 stars 463 forks source link

Error when upgrade Flutter and SDK #65

Closed ikwijaya closed 5 years ago

ikwijaya commented 5 years ago

thanks for awesome plugin.

i have some error, after upgrade flutter . this is my version Flutter 0.10.2 • channel beta • https://github.com/flutter/flutter.git Framework • revision d8cbb80206 (7 weeks ago) • 2018-10-26 01:30:21 -0400 Engine • revision 6c2ade9fa2 Tools • Dart 2.1.0-dev.8.0.flutter-bf26f760b1

and this is my code Future _scanQR() async { print('func scanQR ==> access scan qr 2'); try { print(' try ==> '); String _qrscan = await BarcodeScanner.scan(); Map _map = json.decode(_qrscan); print('scan => '+ _qrscan); } on PlatformException catch (e){ print(' PlatformException ==> '+ e.toString()); if(e.code == BarcodeScanner.CameraAccessDenied){ // Navigator.pushNamed(context, '/dashboard'); toast.show( context: context, message: "Camera Permission is access denied.", status: "error", duration: new Duration(seconds: 3), position: new Offset(15.0, 100.0), ); } else { // Navigator.pushNamed(context, '/dashboard'); toast.show( context: context, message: "Unknown error: $e", status: "error", duration: new Duration(seconds: 3), position: new Offset(15.0, 100.0), ); } } on PlatformException { print(' PlatformException ==> '); // Navigator.pushNamed(context, '/dashboard'); toast.show( context: context, message: 'null (User returned using the "back"-button before scanning anything. Result)', status: "error", duration: new Duration(seconds: 3), position: new Offset(15.0, 100.0), ); } catch (e) { // Navigator.pushNamed(context, '/dashboard'); print(' Catch ==> '); print('Error : $e'); toast.show( context: context, message: 'Error : $e', status: "error", duration: new Duration(seconds: 3), position: new Offset(15.0, 100.0), ); } }

my problem is => code String _qrscan = await BarcodeScanner.scan(); cannot read my qrcode without any error prompted. I/flutter (20956): Opened QrScan Widget I/flutter (20956): func scanQR ==> access scan qr 2 I/flutter (20956): try ==> I/Timeline(20956): Timeline: Activity_launch_request id:com.akak.cekakak time:145907690 D/PhoneWindow(20956): *FMB* installDecor mIsFloating : false D/PhoneWindow(20956): *FMB* installDecor flags : -2139029248 D/PhoneWindow(20956): *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null D/PhoneWindow(20956): *FMB* isFloatingMenuEnabled return false I/Timeline(20956): Timeline: Activity_idle id: android.os.BinderProxy@32016ee time:145907869 V/ActivityThread(20956): updateVisibility : ActivityRecord{86caa1c token=android.os.BinderProxy@3638afbb {com.akak.cekakak/com.akak.cekakak.MainActivity}} show : false W/art (20956): Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[17,tid=21064,Native,Thread*=0x9bda6400,peer=0x12de20a0,"Thread-10171"] D/InputMethodManager(20956): windowDismissed mLockisused = false I/Choreographer(20956): Skipped 43 frames! The application may be doing too much work on its main thread. I/Choreographer(20956): Skipped 43 frames! The application may be doing too much work on its main thread. D/PhoneWindow(20956): *FMB* installDecor mIsFloating : false D/PhoneWindow(20956): *FMB* installDecor flags : -2139029248 D/PhoneWindow(20956): *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null D/PhoneWindow(20956): *FMB* isFloatingMenuEnabled return false I/Choreographer(20956): Skipped 42 frames! The application may be doing too much work on its main thread. I/Timeline(20956): Timeline: Activity_idle id: android.os.BinderProxy@fbfc987 time:145916258 D/InputMethodManager(20956): windowDismissed mLockisused = false

nikhildev commented 5 years ago

I think I have a similar issue too.

I'm using barcode_scan : "0.0.4"

and I get the following error

The current Dart SDK version is 2.1.0-dev.9.4.flutter-f9ebf21297.

Because flutter_barcode depends on barcode_scan >=0.0.2 <0.0.5 which requires SDK version <2.0.0, version solving failed.

Looks like Dart > v2.0.0 is not supported by this package.

ikwijaya commented 5 years ago

yup, case close