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 451 forks source link

Unhandled Exception: MissingPluginException(No implementation found for method scanBarcode on channel flutter_barcode_scanner) #261

Open MateoSchultheis opened 2 years ago

MateoSchultheis commented 2 years ago

E/flutter (30297): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method scanBarcode on channel flutter_barcode_scanner) E/flutter (30297): #0 MethodChannel._invokeMethod package:flutter/…/services/platform_channel.dart:154 E/flutter (30297): E/flutter (30297): #1 FlutterBarcodeScanner.scanBarcode package:flutter_barcode_scanner/flutter_barcode_scanner.dart:43 E/flutter (30297): E/flutter (30297): #2 _BotonesBusquedaWidgetState.scanQR package:prueba3_git/widgets/botones_busqueda_widget.dart:53 E/flutter (30297): E/flutter (30297):

This happens when in the MainActivity.kt file I change from FlutterActivity to FlutterFragmentActivity. I need it FlutterFragmentActivity to start session with biometric data

To Reproduce Steps to reproduce the behavior:

  1. I have a button that calls the method that scans
  2. qrScanRes = await FlutterBarcodeScanner.scanBarcode( "#ff6666", "Cancelar", true, ScanMode.QR); This is where it throws the aforementioned error

Expected behavior You should be able to open the viewfinder of the camera and be able to scan QR or barcode

Smartphone :

Sorry if the report is not right. If you need more information, I will gladly supply it.

kechankrisna commented 2 years ago

E/flutter (30297): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method scanBarcode on channel flutter_barcode_scanner) E/flutter (30297): #0 MethodChannel._invokeMethod package:flutter/…/services/platform_channel.dart:154 E/flutter (30297): E/flutter (30297): #1 FlutterBarcodeScanner.scanBarcode package:flutter_barcode_scanner/flutter_barcode_scanner.dart:43 E/flutter (30297): E/flutter (30297): #2 _BotonesBusquedaWidgetState.scanQR package:prueba3_git/widgets/botones_busqueda_widget.dart:53 E/flutter (30297): E/flutter (30297):

This happens when in the MainActivity.kt file I change from FlutterActivity to FlutterFragmentActivity. I need it FlutterFragmentActivity to start session with biometric data

To Reproduce Steps to reproduce the behavior:

  1. I have a button that calls the method that scans
  2. qrScanRes = await FlutterBarcodeScanner.scanBarcode( "#ff6666", "Cancelar", true, ScanMode.QR); This is where it throws the aforementioned error

Expected behavior You should be able to open the viewfinder of the camera and be able to scan QR or barcode

Smartphone :

  • Device: Xiaomi MI9
  • OS: 11 RKQ1.200826.002

Sorry if the report is not right. If you need more information, I will gladly supply it.

did you have a hotfix?

alexprazeres commented 2 years ago

I fixed mine with:

128

In file FlutterBarcodeScannerPlugin.java

I've modified all reference to FlutterActivity to FlutterFragmentActivity and now it works.

This is a workaround that works for me.

wishwelloklu commented 2 years ago

I fixed mine with: #128

In file FlutterBarcodeScannerPlugin.java I've modified all reference to FlutterActivity to FlutterFragmentActivity and now it works. This is a workaround that works for me.

Where can I find this file, FlutterBarcodeScannerPlugin.java please

kmorfo commented 11 months ago

I fixed mine with: #128

In file FlutterBarcodeScannerPlugin.java I've modified all reference to FlutterActivity to FlutterFragmentActivity and now it works. This is a workaround that works for me.

Where can I find this file, FlutterBarcodeScannerPlugin.java please

By exploring the package you can locate it, it remains hidden in the .pub-cache folder /Users/UserFolder/.pub-cache/hosted/pub.dev/flutter_barcode_scanner-2.0.0/android/src/main/java/com/amolg/flutterbarcodescanner/FlutterBarcodeScannerPlugin.java Then, as @wishwelloklu comments, you have to modify the references FlutterActivity to FlutterFragmentActivity and now it works.

piumantha97 commented 5 months ago

I fixed mine with: In file FlutterBarcodeScannerPlugin.java I've modified all reference to FlutterActivity to FlutterFragmentActivity and now it works. This is a workaround that works for me.

Where can I find this file, FlutterBarcodeScannerPlugin.java please In windows you can find it, By exploring the package you can locate it, it remains hidden in the .pub-cache folder " C:\Users\\AppData\Local\Pub\Cache\hosted\pub.dev\flutter_barcode_scanner-2.0.0\android\src\main\java\com\amolg\flutterbarcodescanner", you have to modify the references FlutterActivity to FlutterFragmentActivity and now it works.