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
相关推荐
恋猫de小郭2 小时前
Dart Skills CLI 1.0 :AI 时代的 Dart 交付支持
android·前端·flutter
9765033355 小时前
iOS 上架/审核 4.3a全面解读-最新
flutter·ios·objective-c·uniapp
2501_915106325 小时前
Flutter iOS混淆打包详细教程与步骤
android·flutter·ios·小程序·uni-app·iphone·webview
lqj_本人6 小时前
Flutter 鸿蒙实战:用 wakelock_plus 三方库给阅读页加上屏幕常亮
flutter·华为·harmonyos
熊猫钓鱼>_>17 小时前
Flutter app_settings 鸿蒙适配实战:Intent 体系到 Want 的跨越
flutter·华为·harmonyos·openharmony·intent·want
里欧跑得慢18 小时前
Flutter主题与样式详解
前端·css·flutter·web
程序员老刘20 小时前
现在回头看,Dart取消宏是无比正确的决定
flutter·ai编程·dart
莫道桑榆晚hh21 小时前
Flutter 双端开发实战:一套代码搞定 iOS + Android,从开发到上架全流程
flutter
Zeaon1 天前
别再手写筛选栏了:一个可组合的 Flutter 选择组件(5 入口 × 7 委托)
android·flutter
事圆则缓1 天前
Flutter 快速上手
flutter