flutter_isolate icon indicating copy to clipboard operation
flutter_isolate copied to clipboard

Unable to run "flutter_local_notification" plugin from an isolate

Open mohaseeb opened this issue 5 years ago • 7 comments

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!

mohaseeb avatar Feb 16 '20 15:02 mohaseeb

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?

espositofulvio avatar Feb 17 '20 09:02 espositofulvio

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).

espositofulvio avatar Feb 17 '20 20:02 espositofulvio

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.

dkobia avatar Mar 21 '20 12:03 dkobia

I get the same error when trying to use with FlutterBleLib. It is not related to activities.

bobulus42 avatar Apr 06 '20 21:04 bobulus42

Any news about this incompatibility being fixed?

moda20 avatar Apr 25 '20 23:04 moda20

Not being able to use shared_preferences within an isolate is a shame

rsanath avatar Nov 16 '20 16:11 rsanath

same issue with cache_manager due to path_provider

letiagoalves avatar Jan 03 '21 20:01 letiagoalves