【问题标题】:pub get failed (65 ' ) exit code 65发布失败(65')退出代码65
【发布时间】:2020-12-19 14:06:03
【问题描述】:
在尝试将包下载到颤振项目时,我变得像:-
[项目]flutter pub 获取
在项目中运行“flutter pub get”...
pubspec.yaml 第 25 行第 5 列的错误:一个依赖项可能只有一个来源。
╷
25 │ ┌ sdk: 颤振
26 │ │ 曲线导航栏:^0.3.3
27 │ │ # 下面将 Cupertino Icons 字体添加到您的应用程序中。
28 │ │ # 与 CupertinoIcons 类一起用于 iOS 样式图标。
ter
29 │ │ cupertino_icons: ^0.1.3
│└──^
╵
发布失败(65;╵)
退出代码 65
【问题讨论】:
标签:
flutter
flutter-dependencies
【解决方案1】:
您收到该错误是因为您的 pubspec.yaml 格式不正确。
你应该拥有它
flutter:
sdk: flutter
curved_navigation_bar: ^0.3.3
而不是
dependencies:
flutter:
sdk: flutter
curved_navigation_bar: ^0.3.3
【解决方案2】:
我遇到了同样的问题,发现了这个fix
注意缩进差异
//Correct way to add dependencies in flutter
dependencies:
flutter:
sdk: flutter
# Carousel Dependecy for sliders
carousel_pro: ^1.0.0
代替:
//Wrong way of adding dependencies in flutter
dependencies:
flutter:
sdk: flutter
# Carousel Dependecy for sliders
carousel_pro: ^1.0.0
【解决方案3】:
依赖:
扑:
sdk:颤动
carousel_pro: ^0.0.13
【解决方案4】:
【讨论】:
-
虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review