flutter_isolate
flutter_isolate copied to clipboard
Unable to run "flutter_local_notification" plugin from an isolate
When I try to initialize
and use
flutter_local_notifications, the plugin initialization fails with the following error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel dexterous.com/flutter/local_notifications)
Here is a simple app to reproduce the error.
Any help is appreciated!
I've got the same error with several plugins, namely flutter_blue, shared_preferences, flutter_secure_storage, that I try to use in an isolate spawned with flutter_isolate. I guess something changed in the latest flutter which rendered flutter_isolate incompatible?
On further investigation, the plugin api changed quite a bit, the registrant registerWith now accept a flutterengine instead of a pluginregistry (also pluginregistry has a different interface even though the old one is still there) while flutter_isolate still passes the flutternativeview's pluginregistry (which is the old interface implementation). I tried a quick hack writing a registrar with the old interface to no avail, as it looks like something else is failing (related to Activities).
Works okay on iOS with shared_preferences
and sqlflite
. However I run into this error on Android. Looks like changes are required for the new v2 plugin implementation.
I get the same error when trying to use with FlutterBleLib. It is not related to activities.
Any news about this incompatibility being fixed?
Not being able to use shared_preferences within an isolate is a shame
same issue with cache_manager due to path_provider