today I was trying to integrate firebase but when I did pub get it throws me version error like-:
C:\Src\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in fire...
Because firebase_auth 0.18.4+1 depends on firebase_core ^0.5.3 and no versions of firebase_auth match >0.18.4+1 <0.19.0, firebase_auth ^0.18.4+1 requires firebase_core ^0.5.3.
So, because fire depends on both firebase_auth ^0.18.4+1 and firebase_core ^0.6.0, version solving failed.
pub get failed (1; So, because fire depends on both firebase_auth ^0.18.4+1 and firebase_core ^0.6.0, version solving failed.)
Process finished with exit code 1
following are the dependencies that I am using right now...
dependencies:
flutter:
sdk: flutter
# cupertino_icons: ^1.0.1
intl:
cloud_firestore: ^0.15.0
firebase_auth: ^0.18.4+1
firebase_core: ^0.6.0
does any know how to solve this kind of error as I tried to change the version number but then I show an error in core or auth...
You can use any:
dependencies:
flutter:
sdk: flutter
# cupertino_icons: ^1.0.1
intl:
cloud_firestore: ^0.15.0
firebase_auth: any
firebase_core: any
dependencies:
cloud_firestore: ^4.0.5
firebase_auth: any
flutter:
sdk: flutter
dev_dependencies:
flutter_lints: ^1.0.0
flutter_test:
sdk: flutter
Or you can use this version
dependencies:
cloud_firestore: ^0.13.4+2
firebase_auth: ^0.15.5+3
flutter:
sdk: flutter
you can use this. Any will help you
Related
auth version: firebase_auth-0.16.1
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth
0.16.1/lib/src/firebase_auth.dart:18:67: Error: Member not found: 'instance'.
static final FirebaseAuth instance = FirebaseAuth._(FirebaseApp.instance);
environment:
sdk: ">=2.7.0 <3.0.0"
pub dependencies :
#firebase dependencies
cloud_firestore: ^1.0.7
firebase_core: ^1.0.4
firebase_auth: ^0.16.0
firebase_database: ^3.0.7
firebase_messaging: ^9.1.1
firebase_storage: ^8.0.4
dependency_overrides:
permission_handler_platform_interface: ^2.0.2
firebase_core: ^1.0.4
plugin_platform_interface: ^1.0.2
firebase_storage_web: ^1.0.4
http: ^0.12.0
You seem to be on a quite old version of the Firebase Authentication package:
firebase_auth: ^0.16.0
The latest version is 3.3.7, so I recommend updating to a newer version to see if that fixes the problem.
this is the package I can't import: firebase_auth: ^3.2.0
I tried importing different verions of it also flutter clean. I also tried flutter pub get, flutter pub upgrade, flutter pub outdated and none worked. I restarted the IDE several times and even created a new project but I stil get the same error in both VS Code and Android Studio.
Here is my pubspect.yaml
version: 1.0.0+1
environment:
sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
animated_text_kit: ^4.2.1
firebase_core: ^1.10.0
cloud_firestore: ^3.1.0
firebase_auth: ^3.2.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^1.0.0
flutter:
uses-material-design: true
assets:
- images/
I used both older versions of firebase_core & firebase_auth and my issue resolved.
firebase_core: ^1.0.0
firebase_auth: ^1.0.0
This error happens while running the command 'flutter packages get'. I have added few dependencies for pubspec.yaml file to use firebase authentication:
name: flutter_auth
description: A new Flutter project.
version: 1.0.0+1
environment:
sdk: ">=2.1.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
flutter_svg: ^0.19.1
firebase_core: ^1.0.1
firebase_analytics: ^5.0.2
cloud_firestore: ^0.12.9+5
firebase_auth: ^1.0.1
google_sign_in: ^5.0.0
dev_dependencies:
flutter_test:
sdk: flutter
After execution of flutter pub get command I'm getting following error:
PS C:\Users\ajant\Downloads\myapp\myapp> flutter packages get
Because cloud_firestore >=0.11.0 <0.13.3 depends on firebase_core ^0.4.0 and flutter_auth depends on firebase_core ^1.0.1, cloud_firestore
>=0.11.0 <0.13.3 is forbidden.
So, because flutter_auth depends on cloud_firestore ^0.12.9+5, version solving failed.
Running "flutter pub get" in Welcome-Login-Signup-Page-Flutter-master...
pub get failed (1; So, because flutter_auth depends on cloud_firestore ^0.12.9+5, version solving failed.)
Try change the dependencies to their current versions:
cupertino_icons: ^1.0.2
flutter_svg: ^0.19.3
firebase_core: ^1.0.1
firebase_analytics: ^7.1.1
cloud_firestore: ^1.0.1
firebase_auth: ^1.0.1
google_sign_in: ^5.0.0
You can find the current version by google searching the dependencies one by one and find the current version in the installing tab. Here is one example:
https://pub.dev/packages/cloud_firestore/install
I want to add firebase_messaging package to my flutter app, but when I install it, an error appeared which is:
Because firebase_messaging >=7.0.3 <8.0.0-dev.7 depends on firebase_core ^0.5.0+1 and elderly_app depends on firebase_core ^0.7.0, firebase_messaging >=7.0.3 <8.0.0-dev.7 is forbidden.
So, because elderly_app depends on firebase_messaging 7.0.3, version solving failed.
pub get failed (1; So, because elderly_app depends on firebase_messaging 7.0.3, version solving failed.)
I have tried to install two versions of firebase_messaging , they are :
firebase_messaging: ^9.0.0 and firebase_messaging: 7.0.3
and also the same error appeard.
These are my dependencies in pubspec.yaml :
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
ff_navigation_bar: ^0.1.5
calendar_timeline: ^0.7.0
date_time_picker: "^1.1.1"
firebase_core: ^0.7.0
firebase_auth: ^0.20.0+1
cloud_firestore: ^0.16.0
modal_progress_hud: ^0.1.3
datetime_picker_formfield: ^1.0.0
adhan: ^1.1.14
image_picker: ^0.6.7+22
syncfusion_flutter_calendar: ^18.4.42
geolocator: ^6.2.1
fluttertoast: ^7.1.6
geocoder: ^0.2.1
some_calendar: ^1.2.6
flutter_calendar_week:
git:
url: https://github.com/mduccc/flutter_calendar_week
ref: 0.1.0
bubble: ^1.1.9+1
firebase_storage: ^7.0.0
charts_flutter: ^0.9.0
firebase_messaging: 7.0.3
try removing the version number and use it like this:
firebase_messaging:
You must update the core version, also keep all firebase products up to dated,
use the following latest release or you will face a lot of problems:
firebase_messaging: ^9.0.0
firebase_core: ^1.0.1
firebase_auth: ^1.0.1
cloud_firestore: ^1.0.1
you can get to know the updates on every package you use by running 'flutter pub outdated'
Running pub get or pub upgrade results in the following error:
Running "flutter pub upgrade" in <project-name>...
Because cloud_firestore >=0.13.3 <0.14.0-dev.1 depends on firebase_core ^0.4.4 and cloud_firestore >=0.11.0 <0.13.3 depends on firebase_core ^0.4.0, cloud_firestore >=0.11.0 <0.14.0-dev.1 requires firebase_core ^0.4.0.
So, because <project-name> depends on both cloud_firestore ^0.13.0+1 and firebase_core ^0.5.0+1, version solving failed.
pub upgrade failed (1; So, because <project-name> depends on both cloud_firestore ^0.13.0+1 and firebase_core ^0.5.0+1, version solving failed.)
My pubspec.yaml:
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cloud_firestore: ^0.13.0+1
provider: ^4.3.2+2
google_sign_in: "^4.5.1"
firebase_core: "^0.5.0+1"
firebase_auth: "^0.18.1+2"
Project is created by following official guides in the last week.
Incrementing the cloud_firestory version in pubspec.yml solved this:
cloud_firestore: ^0.14.0+1