skip to Main Content

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


  1. Try changing file picker veraion to any pubspec.yaml

    file_picker : any
    

    Then flutter clean and flutter pub get. If this doesnt work then downgrade file picker to a smaller version

    file_picker : 5.2.0
    
    Login or Signup to reply.
  2. The error occurs due to incompatible dependencies between the rich_clipboard and file_picker. So not targeting win32 won’t fix your problem. You can downgrade file_picker to 5.3.0 until file_picker or rich_clipboard update their dependencies to be compatible with newer versions of win32 package.

    In your pubspec.yaml set file_picker as following

    file_picker: ^5.3.0
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search