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
相关推荐
森之鸟3 小时前
flutter项目适配鸿蒙
flutter·华为·harmonyos
傅里叶3 小时前
Flutter在OrangePi 5 Plus上视频播放锁死问题
前端·flutter
书弋江山1 天前
flutter 跨平台编码库 protobuf 工具使用
android·flutter
程序员老刘·1 天前
Flutter 3.35 更新要点解析
flutter·ai编程·跨平台开发·客户端开发
tangweiguo030519871 天前
Flutter vs Android:页面生命周期对比详解
flutter
tangweiguo030519871 天前
Flutter网络请求实战:Retrofit+Dio完美解决方案
flutter
来来走走1 天前
Flutter开发 webview_flutter的基本使用
android·flutter
落魄的Android开发1 天前
Flutter以模块化适配 HarmonyOS方案的实现步骤
flutter
tangweiguo030519871 天前
Flutter GetX 全面指南:状态管理、路由与依赖注入的最佳实践
flutter
来来走走1 天前
Flutter Form组件的基本使用
android·flutter