Open xvrh opened 2 weeks ago
Reproducible using the repository provided above.
Is this only happening for macOS / iOS targets or for Android as well?
@bkonyi It happens for all platforms.
In Android, the GeneratedPluginRegistrant.java
will contains references to plugins that are not referenced by the current project.
This is an important bug because it means the final application will be bundled with a bunch of unused native code.
It seems the plugins are derived directly from the package_config.
We should add a filter using the pubspec.yaml
We should add a filter using the
pubspec.yaml
We can't filter with pubspec.yaml
directly, because it doesn't contain the transitive dependency tree.
@stuartmorgan of course, I meant start from the pubspec.yaml and transitively discover all real sub dependencies.
We may even fix an other problem: which is to not include plugins from "dev_dependencies". But this is less important and probably a breaking change to think of separetely.
Steps to reproduce
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
(orflutter 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:Code sample
git clone https://github.com/xvrh/pub_workspace_test
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]Logs
Logs
```console [Paste your logs here] ```Flutter Doctor output
Doctor output
```console Flutter (Channel main, 3.26.0-1.0.pre.131, on macOS 14.5 23F79 darwin-arm64, locale en-BE) ```