MissingPluginException(No implementation found for method canStartScan on channel wifi_scan)-I’m receiving this error for a method in wifi_scan package in my flutter app. But my flutter code was working fine with the same package earlier. I did not make any changes relating to the package or the method. I even reverted all the changes i had made, but the code still throws this error. Any idea on what might be the issue here?
scanNspeakwifi() async{
resultcanstarscan = await WiFiScan.instance.canStartScan(); /* This is the line where the exception occurs*/
// print("passed canstartscan : $resultcanstarscan");
if(resultcanstarscan == CanStartScan.yes){
scansuccess = await WiFiScan.instance.startScan();
// print("scan success: $scansuccess");
notification('Scanning in progress', Colors.yellow);
}
else {
notification('Cannot start scan. Check if location permissions are given!', Colors.red);
}
cangetresults = await WiFiScan.instance.canGetScannedResults();
// print("Passed cangetresults $cangetresults");
if(cangetresults == CanGetScannedResults.yes ){
scanresults = await WiFiScan.instance.getScannedResults();
notification('Scan completed! Click on "Get Results" to view nearby Nspeak device', Colors.green);
}
else {
notification('No scan result available. Check if location permissions are given!', Colors.red);
}
}
I have already tried uninstalling the package, reinstalling it, tried flutter clean. I tried reverting all the changes I have made. But no luck.