MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) #65334
Comments
|
Hi @deepak786 |
flutter doctor -v
flutter build appbundle --verbose
|
|
cc @amirh |
|
It would be useful if you could create a gist with a sample app that demonstrates this so we could reproduce it locally. |
|
I'm also having this issue. I tried downgrading shared_preferences to 0.5.4+3 which I had working this summer but it still does not work. Using --no-shrink does the trick and my app starts. I tried to reproduced with the following steps that I thought would get the same problem but this example works, unfortunately. I'm still trying to troubleshoot why my main app hangs on
|
|
Ok. Solved it for my main app after a long troubleshooting session. When I updated my app icon through Android Studio 4.x - then Android Studio automatically updated my android/build.gradle with a dependency to This is not the whole solution though. If I follow the above reproduction example that I had (that didn't reproduce the problem) I can see that my fresh of the grill So, I'll just fall back to gradle 3.5.1 and everything works. If someone can explain why gradle 4.0.1 causes this problem I'd be grateful even though I do not know any upside to upgrading to 4.0.1 compared to 3.5.1. |
|
@mikeesouth Thanks a lot! Your solution worked for me. |
|
@mikeesouth and @pawsong I am also facing this issue. can you help me for this (#66338). someone was closed this issue without any solution. please help me |
|
Am also having same issue. Any solution for this. |
|
I have the same blocker. Works on Android 8 but not on 10 (neither on physical device nor on emulated). The only "getAll()" I have found is in
Maybe this is some kind of race condition where the store is not fully available at that point?!? |
|
The problem is not only with |
|
@hlemcke please try to upgrade Flutter SDK to the latest stable version. because I was also got this issue using |
|
any updates! |
I'm getting this error and my app was on 3.5.0. Anyone else have any luck getting this working? |
|
I'm getting the same error in debug mode when it runs the following code line: |
Look at it if it helps @mattyx96 |
|
Solved this issue by upgrade other package version. |
Worked for me too! |
|
Below code is working perfect in my project.
} |
Worked for me too. Thanks so much |
|
@NerdFaisal404 can you clarify your solution a bit more? Adding this line prevents that gradle 4.1.0 will remove the SharedPreference code? It seems to make no sense because the class FlutterActivity already includes this method. |
Please look at this solution :- Solution from this thread worked for me: // ignore: invalid_use_of_visible_for_testing_member Using --no-shrink seem to be the only fix so far if we don't want to downgrade gradle. #65334 (comment) |
|
see: #58479 (comment) |
Thanks a lot ! it works perfect to me ! in my case case, the problem was:
Putting here for future searching .... |
Thanks a lot ! it works perfect to me ! |
|
@cyanglaz Can you consider open this issue, since changing to older Gradles is not a good solution? |
|
I get this when I use
in MainActivity.java. When MainActivity is empty I have no problems. It is not related to SharedPreferences, it can be reported for other packages as well on await, which ever call comes first, that is why most of reports are ond SharedPreferences since it is usually called at the beginning. In my case, I have discovered this with await Firebase.initializeApp(), but when I removed Firebase.initializeApp(), then it popup with shared_preferences. And yes, nothing I have tried have helped me. This should be reopen. It is something related to V2 embedding. |
|
I'm solved with change code from mainactivity.kt or mainactivity.java.
after that, flutter clean and run |
Yes this is the solution, I have come to same conclusion after two lost days. Strangley, some examples from FlutterFire came and worked without this line of code, but when I have applied the sam code in my app I got this Exception, so it took me a while to come to this single line of code which fixed the problem. |
This workaround works for me too.
This way (in this situation) I succede in debug some errors in the release apk that doesn't appear in debug mode. |
|
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). I still don't know which 'image_picker' that not conflict with shared_preferences. FYI: I use com.android.tools.build:gradle:4.1.1 and flutter Channel beta, 1.25.0-8.1.pre |
it works for me |
thx got it to work again with: |
|
Guys, I think the solution is quite easy: _shared_preferences: is buggy/broken and it does no longer work --> use something different! Why do I think this is the case? When I run _Running Gradle task 'assembleDebug'... ...\shared_preferences-0.5.12+4\android\src\main\java\io\flutter\plugins\sharedpreferences\MethodCallHandlerImpl.java:121: ...\shared_preferences-0.5.12+4\android\src\main\java\io\flutter\plugins\sharedpreferences\MethodCallHandlerImpl.java:121: I would say, shared_preferences is simply outdated and it can/should not be used anymore, only if you want to continue working with outdated compilation tools or other outdated libraries, like gradle 3.5. Well, depreciated, AsyncTask ... doesn't this point to these strange "does not work with await, but with .then()" and other messages? I understood that some tool in the Flutter build process is trying to rewrite to code to work around this. Maybe this rewriting is not working while shrinking etc. All to complicated for me. Need working libs! Have fun, I am looking for alternatives or spend the time implementing something new from scratch. |
|
I encounter this issue recently, and it turns out that an exception is being thrown in
My solution: Setup |
It is worked on emulator, but it is still failed after built. |
|
If you build android release version using by proguard, /android/app/build.gradle
change to
|
This did it for me! I have to observe a bit longer but after fifth try today (and two hours of work) to deploy the app on Google Play it finally started again on my mobile. Google goes Microsoft, making things worse with each release. THANKS YOU for the tip, MarkusS. |
|
This issue was driving me crazy, but I've finally manage to fix it by migrating project using this guide (Upgrading pre 1.12 Android projects). Actually the migration allowed me to do what is suggested here #65334 (comment), which seems to work for some people, so it makes sense. Hope this can help others! |
Thanks bro ! it works to me ! |
I'm working on a Flutter app in which I'm using the shared_preferences package.
The app is working fine in the debug mode but when I publish the Android app using appBundle, the APK didn't work from Play Store.
I checked the iOS version of the app from the Apple Store but it was working fine.
So the issue was only with the Android version.
In the app main screen, I'm getting the data from Shared Prefs or the default values. Until the data loads, the app shows the Progress Indicator and the Android version shows that Progress Indicator only in the release build.
So I added a catch block to check if there is an error and the app gives the following error:
MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
To resolve that issue, I tried several solutions:
but nothing worked.
Then I tried to create the release build with no-shrink
flutter build apk --no-shrinkflutter build appbundle --no-shrinkand the app worked fine in the release build as well. But the issue is resolved without shrinking the code. So this needs to be fixed.
The text was updated successfully, but these errors were encountered: