andrey-ushakov / flutter_bluetooth_basic

Flutter plugin. Allows to find bluetooth devices & send raw bytes data
BSD 3-Clause "New" or "Revised" License
39 stars 141 forks source link

[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method startScan on channel flutter_bluetooth_basic/methods) #1

Closed iRaySpace closed 4 years ago

iRaySpace commented 4 years ago

Hello. I am trying out using bluetooth connection with your package esc_pos_printer. I am getting error that startScan() is not available which points to this package. [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method startScan on channel flutter_bluetooth_basic/methods)

Here is the source code. Can you put up something, maybe I have missed something.

@override
  Future<void> connect(host, port) async {
    // _printer = await Printer.connect(host, port: port);
    PrinterBluetoothManager printerManager = PrinterBluetoothManager();
    printerManager.scanResults.listen((printer) async {
      print(printer);
    });
    printerManager.startScan(Duration(seconds: 4));
    return;
  }

Thanks for putting up these amazing libraries!

Regards,

Ivan

iRaySpace commented 4 years ago

Solved this one. My esc_pos_printer is locked to earlier version.