Skip to content

pub workspace mixes plugins between projects #155242

@xvrh

Description

@xvrh

Steps to reproduce

  • Create 2 flutter projects in the same "pub workspace"
  • Have these projects uses different Flutter plugins (e.g. project1 uses url_launcher and project2 uses webview_flutter).

Expected results

The 2 projects should be separated. The plugins used by one project should not leak to the other projects (for binary size reasons?).

Actual results

After you run flutter run (or flutter test), you notice that various files from project1 contains pointer to the plugins used by project2 (in files GeneratedPluginRegistrant.swift|java)

Example in GeneratedPluginRegistrant.swift in project2:

import url_launcher_macos
import webview_flutter_wkwebview

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
  UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
  FLTWebViewFlutterPlugin.register(with: registry.registrar(forPlugin: "FLTWebViewFlutterPlugin"))
}

Code sample

git clone https://github.com/xvrh/pub_workspace_test

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
Flutter (Channel main, 3.26.0-1.0.pre.131, on macOS 14.5 23F79 darwin-arm64, locale en-BE)

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listfound in release: 3.26Found to occur in 3.26has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions