flutter_blue
flutter_blue copied to clipboard
Unhandled Exception: MissingPluginException(No implementation found for method startScan on channel flutter_blue_plus/methods)
I entered in the pubspec.yaml the dipendence flutter_blue_plus: ^1.3.1 . I have a button that calls a method. In this method I declare a FlutterBlue instance but: Unhandled Exception: MissingPluginException(No implementation found for method startScan on channel flutter_blue_plus/methods)
Have you tried rebuilding your app ?
yes
The same error sometimes occurs when the application is in background for me
E/flutter ( 8557): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method setLogLevel on channel flutter_blue_plus/methods)
E/flutter ( 8557): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:294:7)
E/flutter ( 8557):
Same issue after upgrading from 1.4.0 that was working fine on IOS and now, with 1.5.2 does not work anymore ...
run flutter clean and try again
Sent from Outlook for Androidhttps://aka.ms/AAb9ysg
From: Santi Aguado @.> Sent: Wednesday, May 24, 2023 8:08:37 PM To: pauldemarco/flutter_blue @.> Cc: Gishobert Gwenzi @.>; Comment @.> Subject: Re: [pauldemarco/flutter_blue] Unhandled Exception: MissingPluginException(No implementation found for method startScan on channel flutter_blue_plus/methods) (Issue #1109)
Same issue after upgrading from 1.4.0 that was working fine on IOS and now, with 1.5.2 does not work anymore ...
— Reply to this email directly, view it on GitHubhttps://github.com/pauldemarco/flutter_blue/issues/1109#issuecomment-1561717001, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZJLC2N3U6GVH52LKZLVXBDXHZFCLANCNFSM6AAAAAAR2DMWWA. You are receiving this because you commented.Message ID: @.***> Gishobert Gwenzi
Full Stack Software Developer
p: +27104439799 m: e: @.***
22 Magwa Crescent, Gateway West, Waterfall City Midrand 2066
petalmafrica.com
+27115848290 +260630020001 +2638677240191
Facebook Twitter LinkedIn
Thanks, now I have a Missing Plugin Implementation on the two lines looking for isOn and isAvailable that worked fine before upgrading:
// SCAN AND ADD BLUETOOTH PORTS
if (Platform.isAndroid || Platform.isIOS) {
FlutterBluePlus ble = FlutterBluePlus.instance;
// await ble.isOn.then((value) async {
// await ble.isAvailable.then((value) async {
await ble.startScan(
// withServices: [Guid('0000ffe0-0000-1000-8000-00805f9b34fb')],
timeout: const Duration(seconds: 4));
ble.scanResults.listen((detectedPorts) async {
// ADD BLE PORTS
for (var port in detectedPorts) {
String? name = port.device.name;
if (name != '') {
ports.add(
{'key': 'BLT ($name)', 'value': name, 'type': 'bluetooth'});
}
}
});
await Future.delayed(const Duration(seconds: 5));
// });
// });
await ble.stopScan();
}