文章目录
一、报错信息
二、问题分析
三、解决方案
一、报错信息
参考 【Flutter】Flutter Gallery 官方示例简介 博客 ;
Flutter Galley 开源项目运行时 , 在 pubspec.yaml 页面 , 点击右上角的 Pub get 按钮 , 报以下错误 ;
项目地址 : https://github.com/flutter/gallery
Y:\001_DevelopTools\010_Flutter\flutter_windows_2.0.2-stable\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in gallery-master...
Because gallery depends on flutter_driver any from sdk which depends on args 1.6.0, args 1.6.0 is required. So, because gallery depends on args ^2.0.0, version solving failed. pub get failed (1; So, because gallery depends on args ^2.0.0, version solving failed.) Process finished with exit code 1
二、问题分析
Because gallery depends on flutter_driver any from sdk which depends on args 1.6.0, args 1.6.0 is required.
该项目需要依赖 args 插件的 1.6.0 版本 , 在 pubspec.yaml 中配置的版本号是 2.0.0 , 配置的版本号高了 ;
三、解决方案
将 args 插件的版本号设置成 1.6.0 ;
args: ^1.6.0
" Pub get " 操作成功 , 报了个警告 , 暂时不处理 ;