Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unhandled Exception: MissingPluginException(No implementation found for method check on channel plugins.flutter.io/connectivity)

I already added connectivity plugin on my pubspec.yaml.

connectivity: ^0.4.6

But still getting this error:

E/flutter ( 4789): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method check on channel plugins.flutter.io/connectivity)
E/flutter ( 4789): #0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
E/flutter ( 4789):
E/flutter ( 4789): #1 Connectivity.checkConnectivity (package:connectivity/connectivity.dart:73:47)

error connectivity is from this line :

  Future<ConnectivityResult> checkConnectivity() async {
    final String result = await methodChannel.invokeMethod<String>('check');
    return _parseConnectivityResult(result);
  }

and I never modified this package, But still get this error no matter what version of this plugin that I use. I hope anyone can help me to solve this error, thank you. Sorry for my bad English.

like image 396
Gian Almada Avatar asked Feb 06 '20 03:02

Gian Almada


People also ask

Why am I getting missingpluginexception when registering plugins?

The MissingPluginException issues are raised due to incorrect registration of plugins.

Is the missingplugin error related to one package?

I got the MissingPlugin error. I found quite some posts about the error. But my case is a bit different. First, my project runs fine in simulator, the error only raises when I run my release app on physical Android. Second, this error is not just related to one package.

What is This flutter plugin for?

This plugin creates isolates that auto marshal plugin work back to the main isolate, without risking a runtime exception that base flutter isolates will normally throw. Run only the source code of the heavy process, that you are allowed to run in a base flutter isolate, by only using the flutter & dart sdk apis directly.

How to generate generatedpluginregistrant files in flutter?

The GeneratedPluginRegistrant files are generated by Flutter build/run tooling. So if you execute flutter build apk or flutter run, it should work. We are working on improving the user experience here, cf. #14560.


2 Answers

This error mostly occurs when you try to Hot Reload or Hot Restart after just adding new package to your pubspec.yaml.

Just stop the running project(app) and then freshly run it again. So that the added package(which contains the implementations) also pushed to the device

like image 89
Crazy Lazy Cat Avatar answered Sep 28 '22 01:09

Crazy Lazy Cat


Flutter clean on terminal, stop the build and running again worked for me

like image 34
viniciusbaca Avatar answered Sep 28 '22 01:09

viniciusbaca