在使用Flutter的时候添加依赖报错了
在这里插入图片描述

Error on line 34, column 5 of pubspec.yaml: A dependency may only have one source.
╷
34 │ ┌ sdk: flutter
35 │ │
36 │ │ cupertino_icons: ^0.1.0
37 │ │ english_words: ^3.1.0
38 │ │ # For information on the generic Dart part of this file, see the
39 │ │ # following page: https://dart.dev/tools/pub/pubspec
40 │ │
41 │ └ # The following section is specific to Flutte.
╵
pub get failed (65; ╵)
在这里插入图片描述

之后发现放错了位置
在这里插入图片描述

在pub get 成功
在这里插入图片描述

还有一种可能 明明没有犯错但还是报错,起先以为是符号错误了,可是反复尝试都没有
在这里插入图片描述
最后 发现引入的时候必须对齐才可以编译成功,sdk注意一定要缩进一格

在这里插入图片描述

Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐