You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[shared_preferences] MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) in isolate #98473
@urvesh-educloud
Since firebase_messaging is third party plugin, can you confirm if the same exception occurs without using that plugin ?
If so, please provide an isolated minimal reproducible code sample. You can try the same using counter app using the plugin and see if you still get same error or not.
@urvesh-educloud
There are already many similar issues filed and were solved. You can just try to search in this repo. One among them is this. See if it helps.
If not, as requested earlier, please provide an isolated minimal reproducible code sample.
This is definitely a problem with the commit above. The updates to the individual platform packages breaks all my background isolates, no matter if FCM, flutter_isolate or flutter_downloader. The correct plugin instance is not correctly registered in the background isolates anymore (not sure what exactly is required there, but now the method channel names are different and the native side is listening on a different channel name).
Thanks for filing this; I've filed #98591 for the general problem (which we weren't aware of when updating the plugins).
While we investigate whether we can adjust Flutter to handle this automatically in the future, here's a workaround that should allow using the current versions of the plugins:
Add dependencies on shared_preferences_android and shared_preferences_ios.
At the beginning of your background isolate entry point, add something like:
if (Platform.isAndroid) SharedPreferencesAndroid.registerWith();
if (Platform.isIOS) SharedPreferencesIOS.registerWith();
Reacted by Peter Leibiger, Absaar, Jabar Basith, Shun Min Chang, Hamid Musayev, Leo D., Ahmed Nabil, Tore Ølmheim, Tommy, Vinicius Sossella and 4 more
@tatraef Please file a new issue with details about your case. You are using versions of shared_preferences_* that this issue doesn't apply to so whatever issue you are having is unrelated to this one.
Note: I have hidden all comments that instruct people to pin old versions of packages, as that a) is causing a lot of confusion (since people are trying to combine it with manual plugin registration, which cannot work) and b) is not a good idea now as it will prevent receiving any future updates. I would ask anyone commenting here to refrain from posting new comments telling people to do that.
To summarize the actual solution: at the start of the entry point for any isolate that needs to use plugins (where you are presumably already calling WidgetsFlutterBinding.ensureInitialized()):
For Flutter 2.11+ (currently master), call DartPluginRegistrant.ensureInitialized(), which will run the Dart plugin registration for all plugins that need it.
For older versions of Flutter, manually call the registerWith of any plugin implementations you use that have Dart registration. For shared_preferences, see above for details.
Since the plan going forward is to require DartPluginRegistrant.ensureInitialized() in isolates, closing as fixed.
Reacted by Adam Bridges, Shun Min Chang, Jocelyn Griselle and Nanda Firmansyah
changed the title [-]MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) in isolate[/-][+][shared_preferences] MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) in isolate[/+]on Mar 8, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
darshankawar commentedon Feb 15, 2022
@urvesh-educloud
Since
firebase_messagingis third party plugin, can you confirm if the same exception occurs without using that plugin ?If so, please provide an isolated minimal reproducible code sample. You can try the same using counter app using the plugin and see if you still get same error or not.
urvesh-educloud commentedon Feb 15, 2022
@darshankawar i need to call shared_preferences to store some value
i have already try with flutter clean, delete pubspeck.lock > pub get
darshankawar commentedon Feb 15, 2022
@urvesh-educloud
There are already many similar issues filed and were solved. You can just try to search in this repo. One among them is this. See if it helps.
If not, as requested earlier, please provide an isolated minimal reproducible code sample.
kuhnroyal commentedon Feb 15, 2022
I am suddenly seeing this error as well after running
flutter pub upgrade. flutter-team-archive/plugins@08ba6bd looks suspiciouskuhnroyal commentedon Feb 15, 2022
This is definitely a problem with the commit above. The updates to the individual platform packages breaks all my background isolates, no matter if FCM,
flutter_isolateorflutter_downloader. The correct plugin instance is not correctly registered in the background isolates anymore (not sure what exactly is required there, but now the method channel names are different and the native side is listening on a different channel name).kuhnroyal commentedon Feb 15, 2022
@BeMacized Do you have an idea what could be missing regarding the registration in background isolates?
kuhnroyal commentedon Feb 15, 2022
maximilienGilet commentedon Feb 16, 2022
rahulmawana commentedon Feb 16, 2022
same here, I started to facing this as I did flutter pub upgrade, currently it was updated "Flutter 2.10.1"
stuartmorgan-g commentedon Feb 16, 2022
Thanks for filing this; I've filed #98591 for the general problem (which we weren't aware of when updating the plugins).
While we investigate whether we can adjust Flutter to handle this automatically in the future, here's a workaround that should allow using the current versions of the plugins:
shared_preferences_androidandshared_preferences_ios.30 remaining items
tatraef commentedon Mar 7, 2022
pedromassango commentedon Mar 7, 2022
@tatraef your code should look like the image below:
tatraef commentedon Mar 7, 2022
stuartmorgan-g commentedon Mar 7, 2022
@tatraef Please file a new issue with details about your case. You are using versions of
shared_preferences_*that this issue doesn't apply to so whatever issue you are having is unrelated to this one.stuartmorgan-g commentedon Mar 7, 2022
Note: I have hidden all comments that instruct people to pin old versions of packages, as that a) is causing a lot of confusion (since people are trying to combine it with manual plugin registration, which cannot work) and b) is not a good idea now as it will prevent receiving any future updates. I would ask anyone commenting here to refrain from posting new comments telling people to do that.
To summarize the actual solution: at the start of the entry point for any isolate that needs to use plugins (where you are presumably already calling
WidgetsFlutterBinding.ensureInitialized()):master), callDartPluginRegistrant.ensureInitialized(), which will run the Dart plugin registration for all plugins that need it.registerWithof any plugin implementations you use that have Dart registration. Forshared_preferences, see above for details.Since the plan going forward is to require
DartPluginRegistrant.ensureInitialized()in isolates, closing as fixed.prjmax commentedon Mar 7, 2022
stuartmorgan-g commentedon Mar 8, 2022
[-]MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) in isolate[/-][+][shared_preferences] MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences) in isolate[/+]Another attempt to get background task working for beacon monitoring.…
Added workaround to fix detaching of plugins in isolated env.
github-actions commentedon Mar 22, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.