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
相关推荐
Non-existent9879 小时前
Flutter + FastAPI 30天速成计划自用并实践-第10天-组件化开发实践
android·flutter·fastapi
kirk_wang10 小时前
Flutter 三方库在 OHOS 平台的适配实践:以 flutter_mailer 为例
flutter·移动开发·跨平台·arkts·鸿蒙
小白的程序空间10 小时前
理解Flutter突出优点
flutter
嗝o゚13 小时前
Flutter跨平台游戏开发的技术创新
flutter·华为
小a杰.14 小时前
原生与Flutter混合开发实践指南
flutter
tangweiguo0305198717 小时前
Flutter 全屏页面路由完全指南:从原理到实战
flutter
QuantumLeap丶17 小时前
《Flutter全栈开发实战指南:从零到高级》- 24 -集成推送通知
android·flutter·ios