I am trying to use firebase for my project. When I click on PUB GET, I get this error!
"Because firebase_auth >=3.5.0 depends on firebase_auth_platform_interface ^6.4.0 which depends on collection ^1.16.0, firebase_auth >=3.5.0 requires collection ^1.16.0.
And because every version of flutter_test from sdk depends on collection 1.15.0, firebase_auth >=3.5.0 is incompatible with flutter_test from sdk.
So, because quick_chat depends on both flutter_test from sdk and firebase_auth ^3.5.1, version solving failed.
pub get failed (1; So, because quick_chat depends on both flutter_test from sdk and firebase_auth ^3.5.1, version solving failed.)"
Pubspec.yml file:
dependencies:
flutter:
sdk: flutter
firebase_auth: ^3.5.1
firebase_core: ^1.20.0
cloud_firestore: ^3.4.1
How do I solve this?
3
Answers
The problem here is:
And package manager cannot decide which version to use.
What you can do here:
Option 1: Upgrade flutter_test (I believe it comes with SDK, so you need to upgrade Flutter SDK)
Option 2: Downgrade firebase_auth to the version that depends on collection 1.15.0
Option 3: Specify dependency_overrides (this will force chose the version of the library, use as last resort):
https://dart.dev/tools/pub/dependencies#dependency-overrides
I have the same issues with you.
For me it takes a couple step. You can consider these steps and choose wisely which isnt for you
Upgrade my flutter, because I currently have 2.8 and now is 3.x
flutter upgrade
After that, still has the same error. I do this one on VS Code terminal
flutter pub upgrade
flutter pub outdated
And then I increase the minSDKVersion of my flutter by going to flutterDirectory(NOT PROJECT DIRECTORY) > packages > flutter_tools > gradle > flutter.gradle.
Edit the
*static int minSdkVersion = 16*
to*static int minSdkVersion = 19*
Hope it works
try add this one.
it will give you a warning on your runner window like this. But it will be okay