Why do i get package this error in flutter - firebase

I am new to flutter, so I am working on firebase authentication and have created a flutter firebase project but I am getting package errors when I run flutter packages get.
My Output looks like this
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS E:\new proj\firebase auth\firebase_auth_demo_flutter-master> flutter packages upgrade
Resolving dependencies...
Because every version of flutter_driver from sdk depends on test_api 0.3.0 and mockito >=4.1.2 <=5.0.0-nullsafety.7 depends on test_api ^0.2.19-nullsafety, flutter_driver from sdk is incompatible with mockito >=4.1.2 <=5.0.0-nullsafety.7.
So, because firebase_auth_demo_flutter depends on both flutter_driver any from sdk and mockito ^4.1.2, version solving failed.
pub finished with exit code 1
PS E:\new proj\firebase auth\firebase_auth_demo_flutter-master>
In my project my pubspec.yaml file looks like this
version: 0.2.0
environment:
sdk: ">=2.11.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
apple_sign_in: ^0.1.0
cupertino_icons: ^1.0.0
firebase_auth: ^0.18.4+1
firebase_core: ^0.5.3
firebase_dynamic_links: ^0.6.3
flutter_login_facebook: ^0.4.0+1
flutter_secure_storage: ^3.3.5
google_sign_in: ^4.5.6
package_info: ^0.4.3+2
provider: ^4.3.2+3
random_string: ^2.1.0
rxdart: ^0.25.0
dev_dependencies:
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter
mockito: ^4.1.2
test: any
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.

The error message starting with "Because every version..." is actually very clear.
You need to increase the version of mockito that you use. You need to use a mockito version that depends on test_api 0.3.0 just like the Flutter SDK you're using does.
When two packages A and B depend on a single package C, there needs to be a version of C that both A and B can work with.

Related

Error with version in Flutter depencies with dialogflow, firebase_auth and http

Hello to everyone and thank's to everyone who can help me.
I've this error with a Flutter projet :
Because flutter_dialogflow >=0.1.3 depends on http ^0.12.0+2 and code depends on http ^0.13.0, flutter_dialogflow >=0.1.3 is forbidden.
So, because code depends on flutter_dialogflow ^0.1.3, version solving failed.
pub get failed (1; So, because code depends on flutter_dialogflow ^0.1.3, version solving failed.)
This error came after added dialogflow. I tried to change different version and ask the community but without success.
Can anyone help me please ?
My pubspec.yaml dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
http: ^0.13.0
shared_preferences: ^2.0.5
numberpicker: ^2.0.0
firebase_core: ^1.1.0
firebase_auth: ^1.1.0
json_annotation: ^3.1.1
url_launcher: ^6.0.3
toast: ^0.1.5
charts_flutter: ^0.10.0
syncfusion_flutter_datepicker: ^19.1.56-beta
flutter_local_notifications: ^5.0.0+3
flutter_launcher_icons: ^0.8.0
flutter_native_timezone: ^1.0.10
flutter_dialogflow: ^0.1.3`
I found a solution by upgrading each dependencies and upgrading my version of the flutter sdk. (Tools --> Flutter --> Flutter Upgrade) in Intellij

Flutter Flash Chat application - Firebase problem

when iam tryin to run the app after adding the following dependencies i got this issues - by the way iam studding anjela flutter course
dependencies:
firebase_core: ^1.2.0
firebase_auth: ^1.2.0
cloud_firestore: ^2.2.0
These warnings can be safely ignored. It just indicates that the packages use deprecated APIs.

Version solving errror with firebase in flutter with some dependancies

I'm getting version-solving errors when trying to add firebase to my flutter project. I have already configured firebase on os and the last step is running flutter pub get. I commented out basic_utils to see if there would be any other conflicts, which is why I know it won't work with google_fonts either. Anybody know what I am doing wrong here? I suspect there are other dependencies that it will conflict with. Is this just something where I have to use an older version of firebase to make it work?
So, because jd_app depends on both firebase_storage ^8.0.0 and google_fonts ^1.1.1, version solving failed.
So, because jd_app depends on both basic_utils ^2.7.1 and firebase_auth ^1.0.1, version solving failed.
Dependencies:
dependencies:
flutter:
sdk: flutter
basic_utils: ^2.7.1
cupertino_icons: ^1.0.1
firebase_auth: ^1.0.1
firebase_core: ^1.0.1
firebase_database: ^6.1.0
firebase_storage: ^8.0.0
flutter_svg: ^0.19.3
get: ^3.24.0
google_fonts: ^1.1.1
image: ^2.1.19
maps_launcher: ^1.2.2+2
provider: ^4.3.3
url_launcher: ^5.5.0
xml: ^4.2.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: ^0.8.1
These are currently the stable version of firebase
firebase_core: ^0.7.0
firebase_auth: ^0.20.1
firebase_storage: ^7.0.0
cloud_firestore: ^0.16.0+1
After a search on the web, it seems that version solving can be easily remedied by following the instructions from this website:
https://iiro.dev/2018/08/28/resolving-dart-package-version-conflicts/ .
According to the link, the dependencies in conflict should be allotted the value 'any.' For example:
firebase_database: any
Subsequently, enter flutter packages get, open the newly generated pubspec.lock file, and then change the version of the dependency in your yaml file to the one in the lock file. Run flutter packages get once more and there should be no more conflicts. At least I didn't have any.
Update ALL the dependencies to the latest version. Check pub.dev to get the current versions

firebase_analytics 0.0.4 which requires SDK version >=1.8.0 <2.0.0, version solving failed

I am trying to learn mobile devt using flutter, dat and firebase. SO as a start I downloaded the chat app code from here
But I can't seem to run the code via vscode and android studio. Can anyone please help me figure out how to run this.
error is:
VScode:
{
"resource": "/C:/Users/Administrator/Downloads/flutter-chat-app-master/flutter-chat-app-master/lib/ChatMessageListItem.dart",
"owner": "dart",
"code": "uri_does_not_exist",
"severity": 8,
"message": "Target of URI doesn't exist: 'package:firebase_database/firebase_database.dart'.\nTry creating the file referenced by the URI, or Try using a URI for a file that does exist.",
"source": "dart",
"startLineNumber": 1,
"startColumn": 8,
"endLineNumber": 1,
"endColumn": 58,
"tags": []
}
this is the error when i run it in android studio.
C:\src\flutter\bin\flutter.bat --no-color packages get Running
"flutter packages get" in flutter-chat-app-master... The current
Dart SDK version is 2.3.0-dev.0.5.flutter-a1668566e5.
Because flutter_chat_app depends on firebase_analytics 0.0.4 which
requires SDK version >=1.8.0 <2.0.0, version solving failed. pub get
failed (1)
I was able to run other sample codes, one is from this so I know that my setup is working.
I already tried few possbile solutions but not working, I saw this , but did not solve my issue.
I think the error requires me to downgrade android sdk but I dont know where to do that. I just need to run so I can see what it looks and I can follow. thanks.
You are using SDK version 2.3 and the package firebase_analytics 0.0.4 requires SDK version >=1.8.0 <2.0.0.
Some dependencies of this project are out of the date.
cupertino_icons: ^0.1.2
firebase_auth: 0.7.0
google_sign_in: 3.2.4
cloud_firestore: 0.8.2+3
fluttertoast: ^2.0.7
image_picker: 0.4.12+1
shared_preferences: 0.4.3
firebase_storage: 1.0.4
cached_network_image: ^0.7.0
intl: ^0.15.7
Update all of them to the newest version.
After a lot of googling , reinstalling, downgrade, upgrade, package get(which never worked coz the error was in the way so it exits before it could 'get'), package upgrade etc, I was finally able to solve this.
The only problem I had was I did not know which version (or what is the latest) to use coz for some reason, it wasn't indicated in their list of "versions", or least it wasn't easy to find coz I always end up in this page. Simply putting these lines (and/or doing the answer above)
environment:
sdk: '>=2.1.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
google_sign_in: ^0.3.1
firebase_analytics: ^0.0.4
firebase_auth: ^0.2.0
firebase_database: ^0.0.12
firebase_storage: ^0.0.5
in yaml did not solve it, although a lot of ppl claimed it did.
the only thing that solved it was when I happen to go in this page where it contains the correct and latest firebase versions that the latest Dart SDK where in my case - DART SDK 2.3 supports.
just get the current version to this You can search every plugin in the search bar.
my yaml looks like this now:
dependencies:
flutter:
sdk: flutter
image_picker: ^0.6.0+8
google_sign_in: ^4.0.1+3
firebase_analytics: ^3.0.1
firebase_auth: ^0.11.1+1
firebase_database: ^3.0.0
firebase_storage: ^3.0.0
Added steps which I am not sure if it is necessary, but I did it before the version correcting.
invalidate cache, restart
In relation with running the app itself, and not particular to firebase:
change gradle version by doing steps from here (because of some error with gradle not related to firebase) and look for answer of keviepanas
Fixed: i got thesame issue as when trying to run flutter upgrade, have tried all the fix online nothing seems to be working, all i deed was upgrade manually and boom, everything worked like magic
1.Download the latest stable version from https://flutter.dev/docs/get-started/install/windows
2.then copy the extracted folder to your flutter directory,
3 delete all files from your previous flutter directory, and paste in the current files
from the latest release
Note: do not delete the flutter sdk directory folder, of cause you cant cause it is already in use.
Summary: all you need do is download the latest version and replace the content(files)with your old flutter sdk files and you are good to go
This combination is working
environment:
sdk: ">=2.1.0<3.0.0"
dependencies:
firebase_core: ^0.3.4
firebase_auth: ^0.8.4+5
cloud_firestore: ^0.9.13+1
flutter:
sdk: flutter
Just try one of the previous versions. The latest one which is dev version is not worked for me. Using an old version worked for me.

Flutter with firestore missing method

MissingPluginException(No implementation found for method DocumentReference#get on channel plugins.flutter.io/cloud_firestore)
Hello, i keep having this message for all the methods of firestore with flutter on an android device simulator.
I followed the install instruction ("gms...google services" in first gradle and plugin on app gradle file, + the google services.json on app folder.
It seems that i should add the firestore api on the android dependencies but this is not on the officiel installation guide.
my pubspec.yaml :
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
firebase_core: ^0.2.5
# firebase_auth: ^0.5.20
cloud_firestore: ^0.8.0
rxdart: ^0.18.1
Plugins depend on the native platform. You need to mock it to make code depending on it run without a device/emulator.
See https://docs.flutter.io/flutter/services/MethodChannel/setMockMethodCallHandler.html, https://docs.flutter.io/flutter/services/BinaryMessages/setMockMessageHandler.html, https://docs.flutter.io/flutter/services/BasicMessageChannel-class.html

Resources