10

Nope. This answer doesn't work this time for me.

My 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.

When I run flutter run, I get:

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)

This is my 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

With the above, please enlighten me, what's wrong?

KhoPhi
  • 9,660
  • 17
  • 77
  • 128
  • Check it out: [Flutter 2 upgrade - Flutter version solving failed error](https://medium.com/@pratikbutani/flutter-2-upgrade-flutter-version-solving-failed-error-33ac1087cb6b) – Pratik Butani Mar 09 '21 at 04:50

2 Answers2

12

That's is because you are using : Dart version 2.1.0-dev.0.0.flutter-be6309690f and the plugin named flutter_circular_chart has a constraint

https://github.com/xqwzts/flutter_circular_chart/blob/master/pubspec.yaml

environment:
   sdk: '>=1.19.0 <2.0.0'

You can fork the project and update the sdk constraint and ref to your repository:

Like this:

flutter_circular_chart:
    git: https://github.com/your_repo/flutter_circular_chart.git

Note Also would be fine if you open an issue in their repo to notify the devs about the issue that you have.

diegoveloper
  • 93,875
  • 20
  • 236
  • 194
  • 1
    What about multiple plugins dependency?... one cant be forking every repo in order to modify them... – Mariano Argañaraz Aug 18 '18 at 21:31
  • 1
    yeah that is something that plugin developers have to take in mind, I mean keeping the plugin updated or the community could help with it. – diegoveloper Aug 18 '18 at 21:32
  • updating SDK version not fixing my version solving issue while I using date picker dropdown plugin. – s.j Jan 11 '21 at 07:29
0

Use devendency_override with same version witch need for same for other dependency.

Like google_maps_flutter: ^0.5.28+1 needs intl to be 0.16.0

then craete dependency_overrides: intl: ^0.16.0

below of dev_dependencies: flutter_test: sdk: flutter

run project until it not run on device.

Enjoy. Thanks..

Vikas
  • 1