dart - 无效的版本约束 : Cannot include other constraints with "^"

标签 dart flutter dart-pub flutter-dependencies

我正在学习和练习 Flutter 的基础知识,但遇到了这个问题。

代码:

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.2+
  english_words: ^3.1.0

执行命令 --no-color packages get 后出现错误:

Error on line 21, column 20 of pubspec.yaml: Invalid version constraint: Cannot include other constraints with "^" constraint in "^0.1.2+".
  cupertino_icons: ^0.1.2+
                   ^^^^^^^

pub get failed (65)

开发平台: 在 Mac OS Mojave 上运行的 Android Studio 3.4

最佳答案

经过网络搜索,我最终来到这里,我犯的错误是添加了一个尾随逗号

改变了这个

flutter_audio_recorder: ^0.5.5,

flutter_audio_recorder: ^0.5.5

关于dart - 无效的版本约束 : Cannot include other constraints with "^",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55772290/

相关文章:

dart - Flutter中如何使用UUID访问数据库?

dart - 那么在 Flutter 中缓存最简单的方法是什么?

flutter - Flutter:Google map 。如何传递这两种标记类型?

flutter - 小部件名称在Flutter中作为变量

dart - 更新尚未在 pub 上更新的库

flutter - 使用定位时如何添加BoxDecoration

android - Flutter - 获取唯一的设备 ID

dart - 从 map 上删除元素

flutter - 如何在抖动中获取音频文件的元数据?

dart - Dart缺少dart.js