当前位置:网站首页>Flutter 库冲突问题解决
Flutter 库冲突问题解决
2022-06-24 19:30:00 【一叶飘舟】
从Git拉Flutter项目到本地后,在Android Studio中执行:
flutter pub get
报 : pub get failed (1; So, because XXXX(项目名) depends on both flutter_cache_manager 1.2.2 and path_provider ^1.6.24, version solving failed.) 版本求解失败:

从上图可知:requires SDK version >=2.10.0-0.0 <2.12.0 ,而我本地 Dart SDKversion 却是2.14.0(我的Flutter是2.5.2,2.0以下没有这个问题),表明该library 与本地Dart版本不兼容,如果我们不想升级本地SDK环境,那么就可以按照以下步骤来进行正确版本选择:
第一步:在pubspec.yaml文件中找到这个依赖,
dependencies
flutter_cache_manager: 1.2.2
path_provider: ^1.6.24
这时,我们将版本换位any,
dependencies
flutter_cache_manager: any
path_provider: any
第二步:命令执行 flutter pub get
第三步:打开pubspec.lock,这个文件是生成我们依赖的所有清单文件,可以看到,
flutter_cache_manager:
dependency: "direct main"
description:
name: flutter_cache_manager
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.2"
path_provider:
dependency: "direct main"
description:
name: path_provider
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.9"
版本号变为了1.4.2和1.6.9,这就是实际引用的版本号,
第四部:将1.4.2和1.6.9替换刚才设置any的位置,(修改其中一个即可。可以升flutter_cache_manager版本 或降path_provider版本,我这里是升flutter_cache_manager版本)
dependencies
# flutter_cache_manager: 1.2.2
# path_provider: ^1.6.24
flutter_cache_manager: 1.4.2
path_provider: ^1.6.24
这样就完美解决了这个问题。
边栏推荐
- SAP接口debug设置外部断点
- 985 test engineer is hanged. Who is more important in terms of education and experience?
- Li Kou daily question - day 25 -496 Next larger element I
- leetcode1863_ 2021-10-14
- Junior college background, 2 years in Suning, 5 years in Ali. How can I get promoted quickly?
- 最大流问题
- 是真干不过00后,给我卷的崩溃,想离职了...
- openGauss内核:简单查询的执行
- A deep learning model for urban traffic flow prediction with traffic events mined from twitter
- 【吴恩达笔记】多变量线性回归
猜你喜欢

手动事务的几个类

【论】Deep learning in the COVID-19 epidemic: A deep model for urban traffic revitalization index

Reduce the pip to the specified version (upgrade the PIP through pycharm, and then reduce it to the original version)

EasyBypass

【论】A deep-learning model for urban traffic flow prediction with traffic events mined from twitter

使用region折叠代码

cv2导包时报Could not find a version that satisfies the requirement cv2 (from versions: none)

I really can't do it. After 00, I collapsed and wanted to leave

刷题笔记(十八)--二叉树:公共祖先问题

Byte software testing basin friends, you can change jobs. Is this still the byte you are thinking about?
随机推荐
Summary of papers on traveling salesman problem (TSP)
滤波数据分析
[untitled]
权限想要细化到按钮,怎么做?
Binary search tree template
[notes of wuenda] fundamentals of machine learning
MySQL gets fields and comments by indicating
即构「畅直播」上线!提供全链路升级的一站式直播服务
Network layer & IP
Kubernetes 集群中流量暴露的几种方案
That is to say, "live broadcast" is launched! One stop live broadcast service with full link upgrade
Drag drag drag
[notes of Wu Enda] convolutional neural network
TKKC round#3
How to achieve energy conservation and environmental protection of full-color outdoor LED display
Elegant custom ThreadPoolExecutor thread pool
leetcode-201_2021_10_17
《各行业零代码企业应用案例集锦》正式发布
[theory] deep learning in the covid-19 epic: a deep model for urban traffic revitalization index
想当测试Leader,这6项技能你会吗?