Flutter error: Unhandled Exception: MissingPluginException(No implementation found for method canLaunch on channel plugins...

If you get a Flutter error like this one:

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

fear not, I get it about once a week. For me it happens every time I add a new plugin to my Flutter project, and then forget to stop my application and restart it. Either that, or you might be working from the command line and forgot to run flutter pub get.

Usually what happens in my workflow is:

  • I’m already running an app with flutter run.
  • I add a new plugin to my project.
  • My IDE runs flutter pub get for me.
  • I add features of the new plugin in my app.
  • I hit r or R on the flutter run screen to reload the app.
  • I get an error message like this one because I forgot that I needed to stop the flutter run process and restart it:
[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method canLaunch on channel plugins.flutter.io/url_launcher)
#0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
<asynchronous suspension>
#1      canLaunch (package:url_launcher/url_launcher.dart:112:25)
<asynchronous suspension>
#2      AboutWidget._launchURL (package:just_be/about.dart:20:19)
<asynchronous suspension>
#3      AboutWidget.build.<anonymous closure> (package:just_be/about.dart:96:27)

So again, this Flutter error message usually isn’t a big deal, it just means you’ve forgotten/missed something in this process.