The exception is [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider). I implement this package to my sample project and it worked. But when I tried to implement to my official project it throwed above exception. How can I fix it? Thanks a lot
3 Answers
See: "The Dreaded MissingPluginException"
This particular error unfortunately gives poor diagnostic information. It can be caused by adding a plugin to your project in debug mode without restarting the app, it can also be caused when using a plugin that creates a second FlutterEngine and plugin loading within that engine fails because one of the plugins in your dependencies has a bug (and in this case it is almost certainly not the plugin that the actual error identifies), or, as most likely in your case, it can be caused in release builds if you use something like Proguard but you did not add rules to keep whatever symbols it is trying to load (you can confirm this by disabling ProGuard and seeing if it works).
There may still be other as yet unknown causes for this error. It's all a bit messy, but for now, follow the above GitHub issue to see the various causes and solutions different people have discovered for this error.
It may also help to read the MissingPluginException FAQ I created for audio_service which may help to track down potential causes for the error.