close

[Solved] No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider

Hello Guys How are you all? Hope You all are fine. When I was trying to run my flutter app and suddenly I get the following error in my stack track. No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider in a flutter. So today Here I come with all possible solutions for this error.

We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.

How No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider Error Occurs ?

Today My application is freezing on the splash screen and I’m getting the following error log:


Syncing files to device Android SDK built for x86...
E/flutter (18870): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)

Syncing files to device Android SDK built for x86...

How to Solve No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider Error?

  1. How to Solve No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider Error?

    To Solve No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider You just have to close Or stop your app and then execute flutter run. That’s it. This will solve your issue.

  2. No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider

    To Solve No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider You just have to close Or stop your app and then execute flutter run. That’s it. This will solve your issue.

Solution 1 : Close App and Flutter Run.

This issue is caused due to when you just add plugin and then get dependencies and just hot reload OR hot restart your flutter app. Hot restart or hot reload is not enough to trigger injection of plugin dependencies. You just have to close Or stop your app and then execute flutter run. That’s it. This will solve your issue.

  1. install your required plugin.
  2. get dependencies using the pub get command.
  3. stop Or close your app.
  4. execute flutter run.
  5. that’s It.

Solution 2 : Disable shrinkResources and minifyEnabled

if you don’t want to minify/obfuscate code just add the two lines inside android/app/build.gradle.

android {
    ...

    buildTypes {
        release {
            ...
         
            shrinkResources false
            minifyEnabled false
        }
    }
}

Solution 3: Flutter for Web

If you are using flutter web then you might face this error cause The getApplicationDocumentsDirectory() function only supports iOS and Android. Just follow below step.

import 'package:flutter/foundation.dart' show kIsWeb;

Then handle setting the directory accordingly:

if (kIsWeb) {
    // Set web-specific directory Here
} else {
    appDocumentDirectory = await path_provider.getApplicationDocumentsDirectory();
}

Solution 4 : Flutter Clean

Just use flutter clean After install plugin. follow below steps.

  1. install your required plugin.
  2. get dependencies using pub get command.
  3. execute flutter clean.
  4. execute flutter run.
  5. that’s It.

Solution 5 : Invalidate Caches/Restart

  1. Simply Run these commands.
  2. Flutter clean
  3. Invalidate Caches/Restart

Solution 6 : Read Plugins documentation.

This is highly recommended to read the first plugin’s documentation. When you install any plugin in your flutter app some of the plugins are required some special permissions, SDK version and etc. Here is some of the example.

Summery

So, It’s All About This Error. I hope this tutorial helps you to Solve your error. Please Comment Below if You stucks anywhere with my code. And please comment below on which solution worked for you. Thank You.

Also Check Out Below Tutorials

Leave a Comment

%d bloggers like this: