无法将flutter_blue包含在我的Flutter项目中

时间:2018-08-15 15:49:44

标签: flutter flutter-dependencies

我试图将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)。

是否有任何变通办法可以使其以某种方式运行,或者有其他替代库可以使用蓝牙?

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

一起使用