simc / dartx

Superpowers for Dart. Collection of useful static extension methods.
https://pub.dev/packages/dartx
Apache License 2.0
1.09k stars 87 forks source link

pub get fails after upgrading flutter version for app developed with previous flutter version #118

Closed KN-Pradeep closed 3 years ago

KN-Pradeep commented 3 years ago

I used to work with the previous stable version of flutter and mainly I used Hive DB to store data locally. I switched to a new machine and currently I have the latest version of flutter downloaded. Currently I am facing problem when I run to get packages. Below is the error

Running "flutter pub get" in myapp_flutter...                    
Because dartx >=0.2.0 <0.5.0 depends on collection >=1.14.11 <1.15.0 and every version of flutter_test from sdk depends on collection 1.15.0-nullsafety.3, dartx >=0.2.0 <0.5.0 is incompatible with flutter_test from sdk.

So, because myapp_mobile depends on both flutter_test any from sdk and dartx ^0.3.0, version solving failed.
pub get failed (1; So, because myapp_mobile depends on both flutter_test any from sdk and dartx ^0.3.0, version solving failed.)
exit code 1

Below is my dependencies mentioned on pubspec.yml

dependency_overrides:
  path: ^1.6.4
  dartx: ^0.5.0

  _The following adds the Cupertino Icons font to your application.
  Use with the CupertinoIcons class for iOS style icons._
  cupertino_icons: ^0.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter
  hive_generator: ^0.7.0+2
  build_runner:
flutter doctor -v
[✓] Flutter (Channel stable, 1.22.5, on macOS 11.1 20C69 darwin-x64, locale en-IN)
    • Flutter version 1.22.5 at /Users/pradeep/Documents/Flutter/flutter
    • Framework revision 7891006299 (2 weeks ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/pradeep/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.3, Build version 12C33
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin installed
    • Dart plugin version 201.9245
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)

[✓] VS Code (version 1.52.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.18.0

[✓] Connected device (3 available)
    • iPhone 12 mini (mobile)             • B8E3F0B3-588F-4810-8837-CDFFF6B3E9F4 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • iPhone 12 Pro Max (mobile)          • 9E0255A3-76DF-4C06-9EFC-FAF3DEAACDD5 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
    • iPhone SE (1st generation) (mobile) • 2F2CC4CD-BB3B-4640-A21F-A46A6458CB27 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)
    ! Error: Pradeep is not connected. Xcode will continue when Pradeep is connected. (code -13)

• No issues found!

passsy commented 3 years ago

The error message and the pubspec.yaml you posted don't match.

Error message: dartx >=0.2.0 <0.5.0 pubspec.yaml: dartx: ^0.5.0 which equals dartx >=0.5.0 <0.6.0

Add dartx: ^0.5.0 to your pubspec.yaml and and run flutter packages upgrade. This error only happens when your pubspec.yaml & pubspec.lock file reference dartx: 0.4.X and you run flutter packages get.