Closed lee4git closed 3 years ago
After clone the repo, I run the example project and when I click on the devices button in the settings section, I get an exception. The exception I got in the platform_channel.dart file is like this Also the find devices function in pub.dev gives this error.
Future<List<Device>> findDevices() async {
return await FlutterSerialPort.listDevices();
}
Hi @hakanbakacak, Are you running the example app on Windows desktop?
Yes, I am running the example app on Windows desktop. Do you have any suggestions for a solution for this issue?
Hi @hakanbakacak, I open another issue for this problem. #10
modify serial_port_flutter/android/src/main/java/com/example/flutter_serial_port/FlutterSerialPortPlugin.java
1. // private SerialPortFinder mSerialPortFinder = new SerialPortFinder();
2. private ArrayList getAllDevices() {
//ArrayList devices = new ArrayList(Arrays.asList(mSerialPortFinder.getAllDevices()));
ArrayList devices = new ArrayList(Arrays.asList( new SerialPortFinder().getAllDevices()));
return devices;
}
3.
private ArrayList getAllDevicesPath() {
//ArrayList devicesPath = new ArrayList(Arrays.asList(mSerialPortFinder.getAllDevicesPath()));
ArrayList devicesPath = new ArrayList(Arrays.asList(new SerialPortFinder().getAllDevicesPath()));
return devicesPath;
}