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
相关推荐
芝麻开门-新起点40 分钟前
Flutter 移动端性能优化指南:内存、电量与 UI 渲染
flutter·ui·性能优化
sugar_hang4 小时前
Flutter路由管理
flutter
程序员老刘5 小时前
Flutter官方拒绝适配鸿蒙的真相:不是技术问题,而是...
flutter·harmonyos·客户端
木易 士心6 小时前
Flutter PC 应用开发指南:从环境搭建到实战避坑
flutter
陈大头铃儿响叮当7 小时前
Android Studio升级后,Flutter运行android设备报错
android·flutter·android studio
勤劳打代码7 小时前
isar_flutter_libs 引发 Namespace not specified
android·flutter·groovy
QuantumLeap丶10 小时前
《Flutter全栈开发实战指南:从零到高级》- 11 -状态管理Provider
android·flutter·ios
安卓开发者11 小时前
第12讲:入门级状态管理方案 - Provider详解
flutter
未来猫咪花11 小时前
为什么 Flutter 不需要 Hooks
flutter
又菜又爱coding1 天前
Android + Flutter打包出来的APK体积太大
android·flutter