我试图将flutter_blue导入由flutter create myapp
生成的项目中,但直接收到错误消息:
Because every version of flutter_test from sdk depends on convert 2.0.1 and flutter_blue 0.4.0 depends on convert ^2.0.2, flutter_test from sdk is incompatible with flutter_blue 0.4.0.
And because no versions of flutter_blue match >0.4.0 <0.5.0, flutter_test from sdk is incompatible with flutter_blue ^0.4.0. ...
pub get failed (1)
我正在使用Flutter 0.5.1(预览版1)。
是否有任何变通办法可以使其以某种方式运行,或者有其他替代库可以使用蓝牙?
答案 0 :(得分:1)
工作环境:
代替0.4.0
。您可以使用previous release 0.3.3
来解决这个问题。
flutter_blue: ^0.3.3
原因:
flutter_blue
更新了其依赖项here,该依赖关系在flutter_test
中尚未更新(正在使用convert 2.0.1)。因此,我们必须降级flutter_blue
才能与flutter
/ flutter_test