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
相关推荐
Zender Han1 天前
Flutter 视频播放器——flick_video_player 介绍与使用
android·flutter·ios·音视频
恋猫de小郭1 天前
Flutter Riverpod 3.0 发布,大规模重构下的全新状态管理框架
android·前端·flutter
RaidenLiu1 天前
Riverpod 3:重建控制的实践与性能优化指南
前端·flutter
蒋星熠2 天前
Flutter跨平台工程实践与原理透视:从渲染引擎到高质产物
开发语言·python·算法·flutter·设计模式·性能优化·硬件工程
卢叁2 天前
Flutter之自定义TabIndicator
前端·flutter
萧雾宇2 天前
Android Compose打造仿现实逼真的烟花特效
android·flutter·kotlin
拜无忧2 天前
【教程】flutter常用知识点总结-针对小白
android·flutter·android studio
拜无忧2 天前
【教程】Flutter 高性能项目架构创建指南:从入门到高性能架构
android·flutter·android studio
醉过才知酒浓2 天前
flutter 拦截返回按钮的方法(WillPopScope or PopScope)
flutter
傅里叶2 天前
sudo启动Flutter程序AMD初始化失败
linux·flutter