不。 This answer doesn't work这次是我。
我的flutter doctor -v
[✓] Flutter (Channel master, v0.5.9-pre.68, on Linux, locale en_US.UTF-8)
• Flutter version 0.5.9-pre.68 at /home/khophi/.flutterSetup
• Framework revision 5cd97f0004 (2 hours ago), 2018-08-16 14:10:22 -0700
• Engine revision 4ee648914f
• Dart version 2.1.0-dev.0.0.flutter-be6309690f
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /home/khophi/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• ANDROID_HOME = /home/khophi/Android/sdk
• Java binary at: /usr/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-0ubuntu0.18.04.1-b11)
• All Android licenses accepted.
[✗] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
[✓] VS Code (version 1.26.0)
• VS Code at /usr/share/code
• Flutter extension version 2.17.1
[✓] Connected devices (1 available)
• klte • 956e8b90 • android-arm • Android 8.1.0 (API 27)
! Doctor found issues in 1 category.
运行flutter run
时,我得到:
Running "flutter packages get" in townsquare...
The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.
Because flutter_circular_chart 0.0.3 requires SDK version >=1.19.0 <2.0.0 and no versions of flutter_circular_chart match >0.0.3 <0.1.0, flutter_circular_chart ^0.0.3 is forbidden.
So, because mobile depends on flutter_circular_chart ^0.0.3, version solving failed.
pub get failed (1)
这是我的pubspec.yaml
name: mobile
description: A new Flutter project.
version: 1.0.0+1
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
carousel: ^0.0.1
http: "^0.11.3+16"
validate: "^1.6.0"
url_launcher: "^3.0.2"
shared_preferences: "^0.4.2"
font_awesome_flutter: "^7.0.0"
flutter_circular_chart: "^0.0.3"
flutter_local_notifications: ^0.3.6
dev_dependencies:
flutter_test:
sdk: flutter
assets:
- images/flutter.jpg
- images/logo.png
- images/bg_viewer.jpg
以上所述,请赐教,怎么了?
答案 0 :(得分:7)
那是因为您使用的是:Dart version 2.1.0-dev.0.0.flutter-be6309690f
并且名为flutter_circular_chart
的插件具有constraint
https://github.com/xqwzts/flutter_circular_chart/blob/master/pubspec.yaml
environment:
sdk: '>=1.19.0 <2.0.0'
您可以派生项目并更新sdk约束并引用到您的存储库:
赞:
flutter_circular_chart:
git: https://github.com/your_repo/flutter_circular_chart.git
注意 如果您在他们的仓库中打开一个问题来通知开发人员您遇到的问题,也可以。
答案 1 :(得分:0)
使用具有相同版本的 devendency_override,其他依赖项也需要相同的版本。
像 google_maps_flutter:^0.5.28+1 需要 intl 为 0.16.0
然后创建dependency_overrides: 国际:^0.16.0
dev_dependencies 的下面: 颤振测试: sdk:颤动
运行项目直到它不在设备上运行。
享受。谢谢..