plus_plugins icon indicating copy to clipboard operation
plus_plugins copied to clipboard

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)

Open sowravroyjoy opened this issue 3 years ago • 7 comments

System info

Platform the Issue occurs on: Android Plugin name: AndroidAlarmManagerPlus Plugin version:2.0.5

Steps to Reproduce

  1. ... I want to use the android alarm manager plus plugin to get some data using the shared preference plugin in the background every few minutes but I can not use the shared preference plugin in that as well as any other. Please provide me with any solution regarding that
  2. ... It says, I need to register the plugin before using it but in the readme, there is no explanation for that how anyone does that.
  3. ...
Logs

image

Flutter doctor output

image

sowravroyjoy avatar Mar 28 '22 17:03 sowravroyjoy

[Windows] package_info_plus: ^1.4.0, the same error.

Syncing files to device Windows...
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel dev.fluttercommunity.plus/package_info)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
<asynchronous suspension>
#1      MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:377:43)
<asynchronous suspension>
#2      MethodChannelPackageInfo.getAll (package:package_info_plus_platform_interface/method_channel_package_info.dart:13:17)
<asynchronous suspension>
#3      PackageInfo.fromPlatform (package:package_info_plus/package_info_plus.dart:36:26)
<asynchronous suspension>
#4      main (package:task_reminder_flutter/main.dart:28:31)
<asynchronous suspension>
 Flutter (Channel stable, 2.10.4, on Microsoft Windows [Version 10.0.19044.1586], locale zh-CN)
    • Flutter version 2.10.4 at D:\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (8 days ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

j787701730 avatar Apr 02 '22 06:04 j787701730

I think it is a problem with flutter itself, since in my case I have the same error with Hive and I believe it is the case for any plugin used on the background thread of AndroidAlarmManagerPlus

Andrew-Bekhiet avatar Apr 05 '22 22:04 Andrew-Bekhiet

I think it is a problem with flutter itself, since in my case I have the same error with Hive and I believe it is the case for any plugin used on the background thread of AndroidAlarmManagerPlus

Now I am sure I upgraded to flutter 2.12.0-4.2.pre (latest beta version) and it works fine

Andrew-Bekhiet avatar Apr 05 '22 23:04 Andrew-Bekhiet

On Windows upgrading to 2.12.0-4.2.pre did not solve the problem

VladislavRUS avatar Apr 06 '22 11:04 VladislavRUS

@sowravroyjoy it seems to be an error of shared_preferences not AndroidAlarmManagerPlus, are you sure you call

  // Be sure to add this line if initialize() call happens before runApp()
  WidgetsFlutterBinding.ensureInitialized();

And if you call SharedPreferences from the background you might need to await again to get its instance.

As of the other issue of package_info_plus that @j787701730 commented its a little bit off topic here(we should focus on AndroidAlarmManagerPlus), and should be resolved in package_info_plus: ^1.4.2 .

fabiancrx avatar Apr 11 '22 01:04 fabiancrx

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Jun 11 '22 00:06 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Sep 19 '22 00:09 github-actions[bot]

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days

github-actions[bot] avatar Dec 29 '22 00:12 github-actions[bot]