Flutter 使用 device_info_plus 遇到的问题

问题:引用device_info_plus 插件出现了异常,不知道为啥打开项目的时候就不能用了。

解决:改了版本解决

c 复制代码
Target of URI doesn't exist: 'package:device_info_plus/device_info_plus.dart'. 
(Documentation)  Try creating the file referenced by the URI, or try using a URI for a file
 that does exist.



在项目中用的是9.1.0,然后改成 3.0.2就行了

而后,又出现如下的错误:两个依赖的版本冲突了,哎,把 package_info_plus 去掉吧,如果没有使用到,或者换插件换插件,其他不知道怎么解决了

c 复制代码
Because device_info_plus >=3.2.1 <4.0.1 depends on device_info_plus_windows ^2.1.1 and device_info_plus >=2.1.0 <3.2.1 depends on device_info_plus_windows ^2.1.0, device_info_plus >=2.1.0 <4.0.1 requires device_info_plus_windows ^2.1.0.
And because device_info_plus_windows >=1.0.0-nullsafety.0 <3.0.0 depends on win32 ^2.0.0 and package_info_plus >=4.0.1 depends on win32 >=4.0.0 <6.0.0, device_info_plus >=2.1.0 <4.0.1 is incompatible with package_info_plus >=4.0.1.
So, because a302 depends on both package_info_plus ^4.2.0 and device_info_plus ^3.0.2, version solving failed.


You can try the following suggestion to make the pubspec resolve:
* Try upgrading your constraint on device_info_plus: flutter pub add device_info_plus:^9.1.0
Process finished with exit code 1
相关推荐
千逐6823 分钟前
《鸿蒙备忘录:基于 Flutter for OpenHarmony 的极简本地笔记应用全实现》
笔记·flutter·harmonyos
果粒蹬i29 分钟前
【HarmonyOS】鸿蒙Flutter智能家居应用开发实战指南
flutter·智能家居·harmonyos
不爱吃糖的程序媛10 小时前
Flutter 与 OpenHarmony 通信:Flutter Channel 使用指南
前端·javascript·flutter
用户661166552965213 小时前
Futter3 仿抖音我的页面or用户详情页
flutter
Haha_bj13 小时前
Flutter ——device_info_plus详解
android·flutter·ios
前端小伙计13 小时前
Android/Flutter 项目统一构建配置最佳实践
android·flutter
微祎_14 小时前
Flutter for OpenHarmony:形状拼图游戏开发全指南 - 基于Flutter CustomPaint的可拖拽矢量拼图实现与设计理念
flutter
不爱吃糖的程序媛15 小时前
解锁Flutter鸿蒙开发新姿势——flutter_ohfeatures插件集实战指南
flutter
一只大侠的侠16 小时前
React Native开源鸿蒙跨平台训练营 Day16自定义 useForm 高性能验证
flutter·开源·harmonyos
子春一16 小时前
Flutter for OpenHarmony:绿氧 - 基于Flutter的呼吸训练应用开发实践与身心交互设计
flutter·交互