Open Christer-Muntean opened 2 years ago
@Christer-Muntean did you resolve the shared preferences issue?
@Christer-Muntean After much trials I discovered you have to re-initialize the shared preferences plugin after entering isolate Using these two plugins; add to pubspec.yaml
shared_preferences_ios: shared_preferences_android:
In your isolate function
if (Platform.isAndroid) { SharedPreferencesAndroid.registerWith(); } else if (Platform.isIOS) { SharedPreferencesIOS.registerWith(); }
Unfortunately due to the way that flutter_isolate
creates new isolates (by creating a new FlutterEngine), many plugins will have incompatibilities that have to be addressed on the plugin side (or at least with workarounds like the one @DennisMuchiri posted). There's not much that can be done on the flutter_isolate
side and this is unlikely to change in the near future.
@Christer-Muntean does reinitializing fix your issue?
I have issues on iOS with this simple code sample, it throws an MissingPluginException. On Android everything works perfectly fine.
flutter_isolate: ^2.0.2
Error spotify_sdk:
Also having problem with shared_preferences:
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)