Skip to content

Dart plugin registration doesn't run in background isolates #98591

@stuartmorgan-g

Description

@stuartmorgan-g

As we've been adopting in-package platform channels in more 1P plugins, which requires Dart plugin registration, we've hit an edge case related to isolates. While plugins don't generally work out of the box in isolates, there are workarounds which, IIUC, run the native plugin registration code in a separate engine instance so that the native side is there. These systems don't know about the new Dart plugin registration though, so half of the registration code is missing, and we end up with mismatches like #98473.

@gaaclarke @blasten (since you've both looked at the engine/VM integration part of the Dart plugin registration) is there a way we can automatically run the generated Dart registration in each new isolate, rather than just the primary isolate? Alternately, could we adjust the generated registration such that it provides a referenceable function that things like flutter_isolate could call during their isolate setup (similar to the need to call WidgetsFlutterBinding.ensureInitialized())?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listengineflutter/engine related. See also e: labels.packageflutter/packages repository. See also p: labels.toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions