Android Studio Flutter项目报错A dependency may only have one source. 网上找了问题 及解决方案 记录如下
Error on line 31, column 5 of pubspec.yaml: A dependency may only have one source.
╷
31 │ ┌ sdk: flutter
32 │ │ uses-material-design: true
33 │ │
34 │ │
35 │ │ # The following adds the Cupertino Icons font to your application.
36 │ │ # Use with the CupertinoIcons class for iOS style icons.
37 │ │ cupertino_icons: ^1.0.2
│ └──^
╵
pub get failed (65; ╵)
Process finished with exit code 65
原因是
pubspec.yaml 文件添加依赖的内容,特别注意 sdk 对齐格式原因是格式不对,没有对齐
原来格式:
flutter:
sdk: flutter
uses-material-design: true
cupertino_icons: ^1.0.2
english_words: ^3.1.0
需要改为如下:
dependencies:
flutter:
sdk: flutter
# uses-material-design: true
cupertino_icons: ^1.0.2
english_words: ^3.1.0
Android studio的代码格式化还不起左右,只能自己手动改…
改完后还要记Pub get 一下
实在无语
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)