dependency_validator icon indicating copy to clipboard operation
dependency_validator copied to clipboard

How to fix "The following packages contain executables" for flutter_native_splash

Open tim-teacher opened this issue 3 years ago • 2 comments

dev_dependencies:
  flutter_native_splash: ^1.2.3

This show error:

The following packages contain executables, they are assumed to be used:
  * flutter_native_splash

What does it mean and how to fix it?

tim-teacher avatar Nov 12 '21 00:11 tim-teacher

Hi @tim-teacher, sorry for the delay in responding. Normally, dependency_validator will fail if any of the following are found:

  • Missing: When a dependency is used in the package but not declared in the pubspec.yaml
  • Under-promoted: When a dependency is used within lib/ but only declared as a dev_dependency.
  • Over-promoted: When a dependency is only used outside lib/ but declared as a dependency.
  • Unused: When a dependency is not used in the package but declared in the pubspec.yaml.

However, package executables make this tricky, because we don't have a good way to know if a project is using the executable provided by one of their dependencies. It might be used during CI or it might just be used during local dev. For that reason, we take the conservative approach and assume that the dependency providing the executable is used so that you don't have to configure dependency_validator to ignore it. When we do that, we print this note so that you can be aware. If you happen to know that you aren't using flutter_native_splash's executable, then you might be able to remove that dependency.

evanweible-wf avatar Nov 30 '21 15:11 evanweible-wf

Hey @evanweible-wf I am working on a mono-repo project and I have created a local package which will have all the lints from a specific package i.e leancode_lint. Now I have the analysis_options.yaml inside the lib folder and it is exported to other local packages. But the dependency_validator shows me error saying leancode_lint is unused or using assets from these packages.

SAGARSURI avatar May 16 '24 11:05 SAGARSURI