[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)
System info
Platform the Issue occurs on: Android Plugin name: AndroidAlarmManagerPlus Plugin version:2.0.5
Steps to Reproduce
- ... 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
- ... 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.
- ...
Logs

Flutter doctor output

[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
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
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
On Windows upgrading to 2.12.0-4.2.pre did not solve the problem
@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 .
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
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
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