Unhandled Exception: MissingPluginException: No implementation found for method xx on channel

Issue

I’m facing an error that all the plugins that I implemented after a certain date won’t work. I tried all the methods(reinstall, flutter clean, rebuild…) on the internet but none of them work, so maybe I’m in a very bizarre situation.

This is my yaml file:

dependencies:
  flutter:
    sdk: flutter
  http :
  intl:
  cupertino_icons: ^1.0.3
  flutter_svg: ^0.23.0+1
  pin_code_fields: ^7.3.0
  flutter_secure_storage: ^4.2.1
  iban: ^1.0.1
  sqflite: ^2.0.0+4
  path: ^1.6.4
  webview_flutter : ^2.3.0
  qr_flutter: ^4.0.0 #qrcode generation
  qrcode_flutter: ^2.0.1
  url_launcher: ^6.0.12 #launching url
  uuid: ^3.0.5
  encrypt: ^5.0.1
  simple_rsa: ^0.0.5
  crypto: ^3.0.1
  crypto_keys: ^0.3.0
  dio: ^4.0.1
  pointycastle: ^3.3.4
//from here, bottom plugins don't work
  screenshot: ^1.2.3 
  image_gallery_saver: ^1.7.1
  permission_handler: ^8.2.6
  email_validator: ^2.0.1  //surprisingly email_validator works
  share_plus: ^3.0.4

flutter doctor:

[✓] Flutter (Channel master, 2.6.0-12.0.pre.837, on macOS 12.0.1 21A559 darwin-x64, locale zh-Hans-FR)
    • Flutter version 2.6.0-12.0.pre.837 at /Users/liuqishu/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 341e771b12 (5 days ago), 2021-11-24 19:33:04 -0500
    • Engine revision e99aba6a38
    • Dart version 2.16.0 (build 2.16.0-46.0.dev)
    • DevTools version 2.8.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/liuqishu/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio 4.2
      Preview.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio
    • Android Studio at /Applications/Android Studio 4.2 Preview.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] VS Code (version 1.62.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (3 available)
    • Qishu’s iPhone (mobile) • 00008101-0011358401E2001E            • ios            • iOS 15.1.1
      19B81
    • iPhone 13 (mobile)      • 56F3E614-0B41-4F96-B7B5-FEE3D5E63006 • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    • Chrome (web)            • chrome                               • web-javascript • Google Chrome
      96.0.4664.55

• No issues found!

error log: (take plugins share for example, in fact any plugin I implement now will show the same kind of error)

[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method share on channel dev.fluttercommunity.plus/share)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
<asynchronous suspension>

All the suggestions will be appreciated.

Solution

Well, finally I figured out this problem, I’m not sure if I’m in a very particular situation, but anyway here is the solution:
each time I build the application, even though the plugins will be installed properly, but the path of the plugins are not imported properly in GeneratedPluginRegistrant.m. So after importing them manually, it works!

ps: the path of the plugins: /your_project_folder/ios/Pods/Target Support Files

an example on how to add plugins manually in GeneratedPluginRegistrant.m:

#if __has_include(<qrcode/QrcodePlugin.h>)
#import <qrcode/QrcodePlugin.h>
#else
@import qrcode_flutter;
#endif

also add it at the bottom of this file, in the resgistry methode:

[QrcodeFlutterPlugin registerWithRegistrar:[registry registrarForPlugin:@"QrcodeFlutterPlugin"]];

Answered By – tim_liu

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published