Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
739 stars 426 forks source link

pub get version solving failed for current firebase_storage ^10.0.1 #328

Closed toebgen closed 2 years ago

toebgen commented 2 years ago

🐛 Bug Report

It seems on flutter channel stable it is not possible to add flutter_cache_manager_firebase right now. Am I missing anything on my side?

Here are the details:

$ flutter pub add flutter_cache_manager_firebase
Because flutter_cache_manager_firebase >=2.0.0 depends on firebase_storage ^8.0.0 and flutter_cache_manager_firebase <2.0.0 depends on path_provider ^1.4.0, every version of flutter_cache_manager_firebase requires firebase_storage ^8.0.0 or path_provider ^1.4.0.
And because <project> depends on firebase_storage ^10.0.1, every version of flutter_cache_manager_firebase requires path_provider ^1.4.0.
So, because <project> depends on both path_provider ^2.0.2 and flutter_cache_manager_firebase any, version solving failed.
pub finished with exit code 65

Reproduction steps

flutter upgrade
flutter pub upgrade
flutter pub upgrade --major-versions

Configuration

$ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale en-GB)
    • Flutter version 2.2.3 at /Users/<>/Projects/flutter
    • Framework revision f4abaa0735 (3 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/<user>/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 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

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

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.164
renefloor commented 2 years ago

First of all

because <project> depends on (...) flutter_cache_manager_firebase any

I would never recommend depending on 'any'.

Because flutter_cache_manager_firebase >=2.0.0 depends on firebase_storage ^8.0.0 ...
And because <project> depends on firebase_storage ^10.0.1

This is the issue in this case, this has nothing to do with "flutter channel stable", but with your project also depending on firebase_storage version 10. Reading the changelog I think it doesn't have breaking changes for this package and should be able to support >=8 < 11 fine.

toebgen commented 2 years ago

Sure, the any resulted from copying the output of flutter pub add flutter_cache_manager_firebase, sorry for that. For correctness, when adding

flutter_cache_manager_firebase: ^2.0.0

to the pubspec.yaml, the output of flutter pub get is:

$ flutter pub get
Because flutter_cache_manager_firebase >=2.0.0 depends on firebase_storage ^8.0.0 and <project> depends on firebase_storage ^10.0.1, flutter_cache_manager_firebase >=2.0.0 is forbidden.
So, because <project> depends on flutter_cache_manager_firebase ^2.0.0, version solving failed.
Running "flutter pub get" in <project>...
pub get failed (1; So, because <project> depends on flutter_cache_manager_firebase ^2.0.0, version solving failed.)

So, how would the version solving be fixed?

Reading the changelog I think it doesn't have breaking changes for this package and should be able to support >=8 < 11 fine.

Would it need an update in this package here?

Please bear with me, if the question sounds silly, still new to Flutter. :-)

ygotthilf commented 2 years ago

Same issue here. The package dependencies requires an update.

@toebgen While waiting a new release, a workaround is to manually override the Firebase Storage dependency in your pubspec.yaml :

dependencies:
  [...]

dependency_overrides:
  firebase_storage: 10.0.1
renefloor commented 2 years ago

I updated to the new dependency in flutter_cache_manager_firebase: ^2.0.1.