-
Notifications
You must be signed in to change notification settings - Fork 51
Resolve the limitation of FFI-based plugins #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
to solve this limitation, do we need re-implement plugins based on native? |
No, we need to check how other platforms tackle this problem but I had not enough time to investigate. |
|
I'll test swift-kim/flutter-tizen@1ed4ee7 when the next stable Flutter version is released. Related engine PR: flutter/engine#25496 |
The implementation of the third solution in flutter-tizen/flutter-tizen#177 (comment) can be found at: swift-kim/flutter-tizen@6fd8233 The commit should land after the next Flutter stable release. cc @HakkyuKim |
@swift-kim That was really fast! Thank you! |
It seems Dart plugin registrants are not yet fully implemented for secondary isolates in the upstream engine: flutter/flutter#81421 Thus the change in #123 (comment) has no effect. |
I tried invoking |
My conclusion is that plugins are generally not expected to work properly inside isolates. This applies to other platforms as well, regardless of the underlying implementation mechanism (platform channel or Dart plugin registrant). (There's even a third-party package called flutter_isolate that allows invoking plugins from isolates.) The only workaround is to call the Example (path_provider_tizen): import 'package:flutter/foundation.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path_provider_tizen/path_provider_tizen.dart';
compute((Object? message) async {
PathProviderPlugin.register();
await getApplicationDocumentsDirectory();
}, null); |
Will be fixed by flutter-tizen/flutter-tizen#516. |
FFI-based plugins (path_provider_tizen, shared_preferences_tizen, url_launcher_tizen) currently only work when running in the main isolate and require additional initialization to run in secondary isolates: #122 (review)
The text was updated successfully, but these errors were encountered: