不。 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

综上所述,请多指教,怎么了?

最佳答案

那是因为您使用的是: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

注意
如果您在他们的仓库中打开一个问题来通知开发人员您所遇到的问题,也可以。

关于升级后的Flutter无法运行应用程序版本解析失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/51886318/

10-09 09:40