-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
Missing calls to "registerWith()" in generated dart_plugin_registrant.dart #113720
Comments
Does setting the minimum Flutter version for the packages to |
Thanks @stuartmorgan ! Increasing the minimum Flutter version did the trick when I tested locally. I will release new packages with the fix asap. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
flutter create my_example
cd my_example
flutter pub add connectivity_plus
flutter pub add package_info_plus
flutter run -d linux
.dart_tool/flutter_build/dart_plugin_registrant.dart
At this point, the contents of the file look like this:
We will observe two problems:
PackageInfoPlusLinuxPlugin.registerWith()
is missing.ConnectivityPlusWindowsPlugin.registerWith()
is missing.If we remove the
connectivity_plus
plugin:flutter pub remove connectivity_plus
, and run the project again, the contents of the file are:Both calls to
PackageInfoPlusLinuxPlugin.registerWith();
andPackageInfoPlusWindowsPlugin.registerWith();
are there.Expected results:
The
dart_plugin_registrant.dart
should contain all registerWith methods.Actual results:
The
dart_plugin_registrant.dart
is missing calls to register plugins properly.In case this helps, here are the links to the codebase of these two plugins, if you can help spot an implementation error in them that may cause these issues:
However, I am afraid this issue may be affecting other packages as well that have multiplatform implementations as
dartPluginClass
.Relevant info: This issue started happening when we refactored the packages from a "Federated Plugin" architecture, and moved all platform implementations into a single package, leaving the platform interface implementation into a separated package. So it looks like that federated plugins are not affected by this, only plugins where all the implementation is contained in the same package.
Code sample
Not neededLogs
Analyze
Flutter Doctor -v
Note: Same issue in Channel Stable.
Related issue reported in plus_plugins: fluttercommunity/plus_plugins#1270
The text was updated successfully, but these errors were encountered: