【问题标题】:flutter pubspec.yaml exit code 65颤振 pubspec.yaml 退出代码 65
【发布时间】:2021-07-30 08:03:48
【问题描述】:

我的 Flutter pubspec.yaml 没有得到包。这个错误显示:

Error on line 30, column 22 of pubspec.yaml: Invalid version constraint: Expected version number after "^" in "^^4.2.1", got "^4.2.1".

   ╷

30 │   animated_text_kit: ^^4.2.1

   │                      ^^^^^^^

   ╵
pub get failed (65;    ╵)
exit code 65

这是我的依赖:

dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  animated_text_kit: ^4.2.1
  cupertino_icons: ^1.0.3
  audioplayers: ^0.16.1

dev_dependencies:
  flutter_test:
    sdk: flutter

我检查了缩进、版本等。

我该怎么办?

【问题讨论】:

  • 你能添加你的 pubspec.yaml 文件吗
  • 检查缩进(制表符与空格)、其他字符等。

标签: android ios flutter dart


【解决方案1】:

pubspec.yaml 上的退出代码 65 表示文件格式不正确。您需要再次检查文件哪里有问题或共享完整的 yaml 文件以便我检查。如果您对格式有信心,或者在终端中尝试flutter clean 然后flutter pub get

【讨论】:

    【解决方案2】:

    尝试下面的代码,然后运行 ​​flutter pub 获取参考文档here

    dependencies:
      flutter:
        sdk: flutter
      audioplayers: ^0.16.1
      animated_text_kit: ^4.2.1
    
      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      
      cupertino_icons: ^1.0.3
    

    【讨论】:

      猜你喜欢
      • 2020-12-19
      • 1970-01-01
      • 2019-10-11
      • 1970-01-01
      • 2021-01-26
      • 2020-03-08
      • 1970-01-01
      • 2020-03-18
      • 1970-01-01
      相关资源
      最近更新 更多