close

[Solved] Flutter: Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)

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. Flutter: Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) 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 Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) Error Occurs ?

I have used shared preference flutter plugin my iOS app. When I was trying to run my flutter app and suddenly I get the following error in my stack track. 

[VERBOSE-2:dart_error.cc(16)] Unhandled exception:
MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
#0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:278:7)
<asynchronous suspension>
#1      SharedPreferences.getInstance (package:shared_preferences/shared_preferences.dart:25:27)
<asynchronous suspension>
#2      main (file:///Users/Developer/workspace/flutter-app/q_flutter2/lib/main.dart:25:53)
<asynchronous suspension>
#3      _startIsolate.<anonymous closure> (dart:isolate/runtime/libisolate_patch.dart:279:19)
#4      _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)

How to Solve Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) Error?

  1. How to Solve Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) Error?

    To solve Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) error You have to Just add shrinkResources false and also minifyEnabled false in build Gradle OR You have to Uninstall your App First then Just Re-install your application.

  2. Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)

    To solve Unhandled exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) error You have to Just add shrinkResources false and also minifyEnabled false in build Gradle OR You have to Uninstall your App First then Just Re-install your application.

Solution 1

If you just set up the plugin for the first time and You just reload or Rerun your app then the above will occur.

So that you have to Uninstall your App First then Just Re-install your application.

Solution 2

Just add shrinkResources false and also minifyEnabled false in build gradle:

android {
   // other stuff

    buildTypes {
        release {
            // other stuff

            shrinkResources false
            minifyEnabled false
        }
    }
}

Solution 3

I Found another solution. Then I faced the same issue when app release with shared_preferences (0.5.12+4) plug in, and it is solved when I removed image_picker: (0.6.7+17). And I still don’t know which ‘image_picker’ that not conflict with shared_preferences.

So I just have to add 2 lines In /android/app/build.gradle. If you build an android release version using by proguard.

/android/app/build.gradle

buildTypes {
    release {
        signingConfig signingConfigs.release

        minifyEnabled true
        useProguard true

        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

change to

buildTypes {
    release {
        signingConfig signingConfigs.release

        minifyEnabled true
        useProguard true

        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

Solution 4 : For iOS

In iOS I face the Same issue. I Have to Try all solutions but nothing was worked. Then I just found I just used the image_picker plugin. and ‘image_picker’ that is conflict with shared_preferences so that I just updated image_picker vesrion.

You can check Which plugin is conflict with shared_preferences by disabling plugin one by one. and when you found which plugin is conflict with shared_preferences you can upgrade Or downgrade that plugin version will resolve your error.

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.

Also Check Out Below Tutorials

Leave a Comment

%d bloggers like this: