当前位置:网站首页>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
这样就完美解决了这个问题。
边栏推荐
- Xinlou: Huawei's seven-year building journey of sports health
- 02---纵波不可能产生的现象
- 栈的两种实现方式
- 【论】Deep learning in the COVID-19 epidemic: A deep model for urban traffic revitalization index
- Drag drag drag
- 我国SaaS产业的发展趋势与路径
- How to refine permissions to buttons?
- Practice of hierarchical management based on kubesphere
- Object. Defineproperty and reflect Fault tolerance of defineproperty
- [camera Foundation (II)] camera driving principle and Development & v4l2 subsystem driving architecture
猜你喜欢

Cannot find reference 'imread' in 'appears in pycharm__ init__. py‘

Want to be a test leader, do you know these 6 skills?

【吴恩达笔记】多变量线性回归

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

I really want to send a bunch of flowers

Opengauss kernel: simple query execution

CV2 package guide times could not find a version that satisfies the requirement CV2 (from versions: none)

好想送对象一束花呀

Application practice | massive data, second level analysis! Flink+doris build a real-time data warehouse scheme

socket(1)
随机推荐
Multithreaded finalization
leetcode1720_ 2021-10-14
Based on asp Net development of fixed assets management system source code enterprise fixed assets management system source code
Graduation design of phase 6 of the construction practice camp
SAP接口debug设置外部断点
Jianmu continuous integration platform v2.5.0 release
That is to say, "live broadcast" is launched! One stop live broadcast service with full link upgrade
Mysql 通过表明获取字段以及注释
[untitled]
Detailed installation and use of performance test tool wrk
Datakit 代理实现局域网数据统一汇聚
leetcode_191_2021-10-15
These map operations in guava have reduced my code by 50%
是真干不过00后,给我卷的崩溃,想离职了...
Getting started with typescript
Datakit agent realizes unified data aggregation in LAN
旅行商问题(TSP)的相关论文总结
MySQL gets fields and comments by indicating
St Table + two points
Make tea and talk about heroes! Leaders of Fujian Provincial Development and Reform Commission and Fujian municipal business office visited Yurun Health Division for exchange and guidance