I’m building a web app with dart/flutter.
I’d like to use file_picker with rich_clipboard but when I try and add the latter I get this messageā¦
flutter pub add rich_clipboard
Because rich_clipboard_windows >=1.0.2 depends on win32 >=2.5.1 <5.0.0 and rich_clipboard_windows <1.0.2 depends on win32 ^2.5.1,
every version of rich_clipboard_windows requires win32 >=2.5.1 <5.0.0.
And because file_picker >=5.3.2 depends on win32 ^5.0.2, file_picker >=5.3.2 is incompatible with rich_clipboard_windows.
Because rich_clipboard <1.0.0 depends on rich_clipboard_windows ^0.0.1 and rich_clipboard >=1.0.0 depends on rich_clipboard_windows
^1.0.0, every version of rich_clipboard requires rich_clipboard_windows ^0.0.1 or ^1.0.0.
Thus, file_picker >=5.3.2 is incompatible with rich_clipboard.
So, because [] depends on both file_picker ^5.3.2 and rich_clipboard any, version solving failed.
I don’t need to target win32 – does that enable a solution?
2
Answers
Try changing file picker veraion to any pubspec.yaml
Then flutter clean and flutter pub get. If this doesnt work then downgrade file picker to a smaller version
The error occurs due to incompatible dependencies between the
rich_clipboard
andfile_picker
. So not targeting win32 won’t fix your problem. You can downgradefile_picker
to5.3.0
untilfile_picker
orrich_clipboard
update their dependencies to be compatible with newer versions ofwin32
package.In your pubspec.yaml set
file_picker
as following