Flutter: Unhandled Exception: Missingpluginexception(No Implementation Found for Method Getall on Channel Plugins.Flutter.Io/Shared_Preferences)

Flutter MissingPluginException(No implementation found for method getAll on channel ...) in release app

This is a classic mistake that allot of people make.
What you are trying to do is abstract heavy work to an isolate, however flutter isolates cannot run plugins, other than the api in flutter and the dart sdk directly.

You have a couple of options.

  1. There is a plugin I can recommend, it does not support all flutter (3rd party) plugins, but it's worth a try with yours.
    https://pub.dev/packages/flutter_isolate

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.


  1. 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. The rest of the code that depends on plugins, will need to be relayed back to the main isolate, and the UI will have to wait for a result using a FutureBuilder

MissingPluginException while using plugin for flutter

If you are using hot restart or hot reload, it won't do the trick.
Since Flutter has to inject plugin dependencies into the platform-specific parts of your app, hot restart/hot reload is not enough to trigger the injection.
Check this issue for more.

Close the app and execute flutter run command.



Related Topics



Leave a reply



Submit