AmolGangadhare / flutter_barcode_scanner

Barcode scanner plugin for flutter. Supports barcode scanning for Android and iOS
https://pub.dev/packages/flutter_barcode_scanner
MIT License
379 stars 457 forks source link

Unhandled Exception: MissingPluginException #7

Closed MagicalWater closed 5 years ago

MagicalWater commented 5 years ago

my code

Future scan() async {
    String res = await FlutterBarcodeScanner.scanBarcode("00ccbb", "Cancel", true);
    print("qr scan ${res}");
}

and report error

Unhandled Exception: MissingPluginException(No implementation found for method scanBarcode on channel flutter_barcode_scanner)
#0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:300:7)
AmolGangadhare commented 5 years ago

Hi, I'll need some information. 1-> Please confirm are you using it from pub or by cloning it (If using from pub, do you get any errors while Packages get in pubspec.yaml). Usually, this error occurs due to errors in Packages get.

The color code you are passing try adding #00ccbb instead of 00ccbb and check. Also after adding plugin do a full restart (stop the app and run again)

AlanCZ commented 5 years ago

hello, I also encountered the same problem it occurs when you return from the app and return again

my code : Future scanQrCode() async { String barcode = await FlutterBarcodeScanner.scanBarcode("#8f498e", "取消", false); print("qrcode ====> $barcode"); }

AlanCZ commented 5 years ago

hello, I also encountered the same problem it occurs when you return from the app and return again

AmolGangadhare commented 5 years ago

@AlanCZ I was not able to reproduce this. Can you add some more logs and steps to reproduce this? Is this occurred on Android or in iOS or in both?

AmolGangadhare commented 5 years ago

@MagicalWater @AlanCZ @fikurniawan @NewComerBH @MatteoColombo Thanks for using the plugin and reporting the issue. I've clubbed all similar issues to this to keep all at the same place.

This error seems to occur frequently for many users. I request to please perform some preliminary actions.

  1. If you are using Android Studio just try Invalidate cache and Restart once meanwhile uninstall the existing installed app from the phone.
  2. open cmd/ terminal goto project and do flutter clean
  3. Go to pubspec and add the latest version of the plugin which is 0.1.5 and click pub packages get.
  4. Run project.

I request to please acknowledge that the issue been resolved or not for you.

Thanks

MatteoColombo commented 5 years ago

@AmolGangadhare I had already tried with version 0.1.5 and after flutter clean, but it's still happening. Here is another log:


E flutter : [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method scanBarcode on channel flutter_barcode_scanner)
E flutter : #0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314)
E flutter : <asynchronous suspension>
E flutter : #1      FlutterBarcodeScanner.scanBarcode (package:flutter_barcode_scanner/flutter_barcode_scanner.dart:34)
E flutter : <asynchronous suspension>
E flutter : #2      AddBookFloat._addBook (package:dima2018_colombo_troianiello/view/library-page/add-book-float.dart:22)
E flutter : <asynchronous suspension>
E flutter : #3      AddBookFloat.build.<anonymous closure> (package:dima2018_colombo_troianiello/view/library-page/add-book-float.dart:16)
E flutter : #4      _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635)
E flutter : #5      _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:711)
E flutter : #6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182)
E flutter : #7      TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365)
E flutter : #8      TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275)
E flutter : #9      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455)
E flutter : #10     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75)
E flutter : #11     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102)
E flutter : #12     _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218)
E flutter : #13     _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198)
E flutter : #14     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156)
E flutter : #15     _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102)
E flutter : #16     _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86)
E flutter : #17     _rootRunUnary (dart:async/zone.dart:1136)
E flutter : #18     _CustomZone.runUnary (dart:async/zone.dart:1029)
E flutter : #19     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931)
E flutter : #20     _invoke1 (dart:ui/hooks.dart:250)
E flutter : #21     _dispatchPointerDataPacket (dart:ui/hooks.dart:159)
E flutter : 
E libc    : Access denied finding property "vendor.debug.egl.swapinterval"
W 4.gpu   : type=1400 audit(0.0:40701): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=21701 scontext=u:r:untrusted_app:s0:c230,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
W 4.gpu   : type=1400 audit(0.0:40702): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=21701 scontext=u:r:untrusted_app:s0:c230,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
E libc    : Access denied finding property "vendor.debug.egl.swapinterval"

`
AmolGangadhare commented 5 years ago

Hi,

I've added a potential fix to this issue with release 0.1.5+1. I need help from you. I request you to check it out with the new version and acknowledge if possible.

MatteoColombo commented 5 years ago

Hi, it seems that the bug is solved. I'll let you know if it will happen again. Thank you!

AmolGangadhare commented 5 years ago

@MatteoColombo Thanks for checking. If you face any issue please feel free to report.

AmolGangadhare commented 5 years ago

Closing this as it seems to be resolved.

mariolouisvincent commented 4 years ago

@AmolGangadhare I have encountered an error regarding an issue @MatteoColombo had and I have tried the fixes you suggested which are:

Case: I am building an App where I scan a barcode and if code matches mobile device may access administrative permissions to device. I am having an issue when I communicate with the MainActivity.java in my project which also has a MethodCall. Could that be a conflict to the MethodCall in the plugin?

Error: E/flutter (27900): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method scanBarcode on channel flutter_barcode_scanner) E/flutter (27900): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:154:7) E/flutter (27900): E/flutter (27900): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12) E/flutter (27900): #2 FlutterBarcodeScanner.scanBarcode (package:flutter_barcode_scanner/flutter_barcode_scanner.dart:42:43) E/flutter (27900): #3 _ScanQRControllerState.scanQRCode2 (package:FlutterApp/Controllers/ScanQRController.dart:112:47) E/flutter (27900): #4 _ScanQRControllerState.build. (package:FlutterApp/Controllers/ScanQRController.dart:64:32) E/flutter (27900): #5 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19) E/flutter (27900): #6 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:862:36) E/flutter (27900): #7 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) E/flutter (27900): #8 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:504:11) E/flutter (27900): #9 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:282:5) E/flutter (27900): #10 BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:217:7) E/flutter (27900): #11 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:475:9) E/flutter (27900): #12 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:76:12) E/flutter (27900): #13 PointerRouter._dispatchEventToRoutes. (package:flutter/src/gestures/pointer_router.dart:122:9) E/flutter (27900): #14 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:379:8) E/flutter (27900): #15 PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:120:18) E/flutter (27900): #16 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:106:7) E/flutter (27900): #17 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19) E/flutter (27900): #18 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22) E/flutter (27900): #19 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7) E/flutter (27900): #20 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7) E/flutter (27900): #21 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7) E/flutter (27900): #22 _rootRunUnary (dart:async/zone.dart:1196:13) E/flutter (27900): #23 _CustomZone.runUnary (dart:async/zone.dart:1085:19) E/flutter (27900): #24 _CustomZone.runUnaryGuarded (dart:async/zone.dart:987:7) E/flutter (27900): #25 _invoke1 (dart:ui/hooks.dart:275:10) E/flutter (27900): #26 _dispatchPointerDataPacket (dart:ui/hooks.dart:184:5)