You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
package assets declared under dev_dependency shouldn't be included in release bundle #79261
Expected results: Flutter should ignore package assets declared under dev_dependency on release bundle / version
Actual results: Flutter include the package assets declared under dev_dependency on release bundle / version
Logs
[✓] Flutter (Channel stable, 2.0.2, on Linux, locale en_US.UTF-8)
• Flutter version 2.0.2 at /home/rubyh/Flutter/flutter
• Framework revision 8962f6dc68 (3 weeks ago), 2021-03-11 13:22:20 -0800
• Engine revision 5d8bf811b3
• Dart version 2.12.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /home/rubyh/Android/Sdk
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = /home/rubyh/Android/Sdk
• ANDROID_SDK_ROOT = /home/rubyh/Android/Sdk
• Java binary at: /usr/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04)
• All Android licenses accepted.
Related Issues:
Do not create plugins from dev_dependencies #56591
Don't include dev_dependencies in native build scripts #45714
integration_test embedded in shipping iOS apps when added to pubspec #74274
After reading this StackOverflow and https://dart.dev/tools/pub/dependencies#dev-dependencies I'm considering this as proposal as there is not documentation saying that assets from dev dependencies will not be included into the final app bundle.
If you have any reference about that please share the link.
Thank you
Hi, @pedromassangocode I'm not sure why it is a proposal not a bug, if the reason to label this as proposal was documentation,
so far I didn't find any flutter documentation saying anything on how dev_dependencies behave with final app bundle as well. by that reasoning dev_dependencies shouldn't work with flutter at all.
If flutter follows dart documentation on dev_dependencies which means ignoring the package on the final app bundle, then flutter should ignore the assets declared as well.
Reacted by Robert Steiner, Akash Gurava, Ali Ebrahim, jiageng, Gonçalo Santos, Maksim Zakharov and Giulio Zaccaroni
public final class GeneratedPluginRegistrant {
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
flutterEngine.getPlugins().add(new dev.flutter.plugins.integration_test.IntegrationTestPlugin());
}
}
after checking classes.dex in my release bundle, the IntegrationTestPlugin is included, so basically everything under dev_dependencies is included in the release bundle? I'm not sure how to check if the dart code is included in the release bundle. since there is no documentation mentioning this does it mean it is as per existing behavior? so including integration test in the final release bundle is normal ?
Reacted by Rick Krystianne Lim, Maksim Zakharov, Ali Ebrahim, jiageng and Mihir
Up for this issue (sorry for not just reacting), but one use-case that might be quite annoying is: say you have an assets that are only meant to be shipped during development and you don't want that to be included in the release bundle, it won't be possible until some exclusion of assets for production build is done.
Right now there's couple of solution that might work (e.g. using script that deletes some dependency or assets during flutter build, but I'd have to admit that's not pretty.
I'm here because I just discovered that in one of my projects I've been placing essential package references under 'dev_dependencies' this whole time - and yet, my release builds have been running flawlessly. I figure it might have something to do with this
Just curious is there a plugin/package on dev_dependencies that contains large enough assets? Because I have never found a plugin/package that has very large assets on dev_dependencies 🤔
Just curious is there a plugin/package on dev_dependencies that contains large enough assets? Because I have never found a plugin/package that has very large assets on dev_dependencies 🤔↳
Sometimes we want to use certain resources only under debug.
We were affected by this issue today. The inclusion of integration_test in dev_dependencies caused a crash in our release build. Very unintuitive, as dev_dependencies was far from the first place we went looking for the cause of a crash in the release build.
As it seems this is actually the way flutter behaves - we basically have no option but to inject the integration test dependencies into the pubspec.yaml as part of the runner script launching the tests. Not optimal.
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 flutter doctor -v and a minimal reproduction of the issue.
Activity
pedromassangocode commentedon Mar 29, 2021
After reading this StackOverflow and https://dart.dev/tools/pub/dependencies#dev-dependencies I'm considering this as proposal as there is not documentation saying that assets from dev dependencies will not be included into the final app bundle.
If you have any reference about that please share the link.
Thank you
rh-id commentedon Mar 29, 2021
Hi, @pedromassangocode I'm not sure why it is a proposal not a bug, if the reason to label this as proposal was documentation,
so far I didn't find any flutter documentation saying anything on how
dev_dependenciesbehave with final app bundle as well. by that reasoningdev_dependenciesshouldn't work with flutter at all.If flutter follows dart documentation on
dev_dependencieswhich means ignoring the package on the final app bundle, then flutter should ignore the assets declared as well.rh-id commentedon Apr 6, 2021
hi @pedromassangocode Additional findings:
When adding
integration_testpackage todev_dependencies,GeneratedPluginRegistrantclass generate the integration test class as well.pubspec.yamlafter checking
classes.dexin my release bundle, theIntegrationTestPluginis included, so basically everything underdev_dependenciesis included in the release bundle? I'm not sure how to check if the dart code is included in the release bundle. since there is no documentation mentioning this does it mean it is as per existing behavior? so including integration test in the final release bundle is normal ?1 remaining item
blackmenthor commentedon Apr 19, 2023
Up for this issue (sorry for not just reacting), but one use-case that might be quite annoying is: say you have an assets that are only meant to be shipped during development and you don't want that to be included in the release bundle, it won't be possible until some exclusion of assets for production build is done.
Right now there's couple of solution that might work (e.g. using script that deletes some dependency or assets during
flutter build, but I'd have to admit that's not pretty.like-clockwork commentedon Aug 20, 2023
I'm here because I just discovered that in one of my projects I've been placing essential package references under 'dev_dependencies' this whole time - and yet, my release builds have been running flawlessly. I figure it might have something to do with this
chandrabezzo commentedon Sep 13, 2023
Just curious is there a plugin/package on dev_dependencies that contains large enough assets? Because I have never found a plugin/package that has very large assets on dev_dependencies 🤔
MeandNi commentedon Apr 15, 2024
Sometimes we want to use certain resources only under debug.
rh-id commentedon Apr 28, 2024
Hi all, adding related issues above. It seemed to occur on other platforms
zhujiageng commentedon Oct 28, 2024
any update?
taltap-jake commentedon Dec 19, 2024
We were affected by this issue today. The inclusion of
integration_testindev_dependenciescaused a crash in our release build. Very unintuitive, asdev_dependencieswas far from the first place we went looking for the cause of a crash in the release build.As it seems this is actually the way flutter behaves - we basically have no option but to inject the integration test dependencies into the pubspec.yaml as part of the runner script launching the tests. Not optimal.
Only bundle assets and plugins from transitive closure of dependencies (
github-actions commentedon Jun 2, 2025
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
flutter doctor -vand a minimal reproduction of the issue.Only bundle assets and plugins from transitive closure of dependencie…