Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in unit test - MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider) #37

Open
medleykupps opened this issue Sep 9, 2020 · 2 comments

Comments

@medleykupps
Copy link

I'm unit testing a service that relies on FLog.

My service's method contains a logging statement, FLog.info(text: 'message'); that results in the following error:

MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)

When I change the logging call to FLog.trace(text: 'message');, it works fine...guessing because it doesn't actually try and write a log entry.

Is there a way around this? Can I mock the FLog method calls? Or, do I need to create my own logging interface that calls FLog internally, and, then mock that interface in my unit tests?

@slc1973
Copy link
Contributor

slc1973 commented Sep 24, 2020

Solution from @asidt could help you: flutter/flutter#10912 (comment)

@danielRi
Copy link

danielRi commented May 4, 2022

@slc1973 The solution in your link used to work. But since 2.10.5 I keep getting this error, described in this issue. Any other solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants