Flutter 运行pub get时出现抖动图像\u选择器插件错误

Flutter 运行pub get时出现抖动图像\u选择器插件错误,flutter,dart,Flutter,Dart,在添加了flatter image_picker插件后,我试图运行pub-get时,在Android Studio iOS模拟器中遇到了这个错误 Because image_picker >=0.7.0 depends on image_picker_platform_interface ^2.0.0 which depends on http ^0.13.0, image_picker >=0.7.0 requires http ^0.13.0. And because http

在添加了flatter image_picker插件后,我试图运行pub-get时,在Android Studio iOS模拟器中遇到了这个错误

Because image_picker >=0.7.0 depends on image_picker_platform_interface ^2.0.0 which depends on http ^0.13.0, image_picker >=0.7.0 requires http ^0.13.0.
And because http >=0.13.0 depends on http_parser ^4.0.0, image_picker >=0.7.0 requires http_parser ^4.0.0.
And because dio 3.0.10 depends on http_parser >=0.0.1 <4.0.0 and no versions of dio match >3.0.10 <4.0.0, image_picker >=0.7.0 is incompatible with dio ^3.0.10.
So, because brief9_pro depends on both dio ^3.0.10 and image_picker ^0.7.5+3, version solving failed.



pub get failed (1; So, because brief9_pro depends on both dio ^3.0.10 and image_picker ^0.7.5+3, version solving failed.)
由于image\u picker>=0.7.0依赖于image\u picker\u平台接口^2.0.0,后者依赖于http^0.13.0,因此image\u picker>=0.7.0需要http^0.13.0。
由于http>=0.13.0依赖于http_解析器^4.0.0,因此图像选取器>=0.7.0需要http_解析器^4.0.0。
因为dio 3.0.10依赖于http_解析器>=0.0.1,所以3.0.10=0.7.0与dio^3.0.10不兼容。
因此,由于brief9_pro同时依赖于dio^3.0.10和image_picker^0.7.5+3,因此版本解决失败。
发布获取失败(1;因此,因为brief9_pro同时依赖于dio^3.0.10和image_picker ^0.7.5+3,版本解决失败。)

您可以尝试将这一行添加到您的pubspec.yaml中吗

dependency_overrides:
   http_parser: ^4.0.0

将dio和http_解析器更新为最新版本

dependency_overrides:
      dio: ^4.0.0
       http_parser: ^4.0.0
解决者:

  • flatter升级
  • 更新dio插件
  • flatter clean
  • flatter pub get