I have a problem with the Flutter i need to skip the a error without updating intl or flutter_localizations - flutter

I have a problem with the Flutter i need to skip an error without updating intl
Running "flutter pub get" in fltox...
Because every version of flutter_localizations from sdk depends on
intl 0.16.0 and fstore depends on intl 0.15.8, flutter_localizations
from sdk is forbidden.
dependencies:
logs:
git: https://github.com/pq/logs
flutter:
sdk: flutter
intl: 0.15.8
path: 1.6.4
more info
[✓] Flutter (Channel beta, v1.12.13+hotfix.6, on Linux, locale en_US.UTF-8)
• Flutter version 1.12.13+hotfix.6 at /home/ppain/development/flutter
• Framework revision 18cd7a3601 (5 weeks ago), 2019-12-11 06:35:39 -0800
• Engine revision 2994f7e1e6
• Dart version 2.7.0.
ples help :)

The actual problem here is that fstore library depends on intl: v0.16.0 but you have specifically defined any version above v0.15.8.
Which is causing this error.
To resolve this you can do the following:
You can update the intl library to v0.16.0
You can downgrade the fstore library to the version which supports v0.15.8
I would suggest the second approach only if you have some specific dependency in your app which requires intl:v0.15.8 and no other.
However if your code requires some specific library version, I would suggest to make it more flexible to work with any version, otherwise in future you'll not be able to use some very useful new features of the library because of this.

so i fix it by use
flutter version .
this command will show a list of flutter version
by use
flutter version xxx
ex:
$ flutter version v1.7.8
will download this flutter version v1.7.8 or what you need .

Related

SDK in pubspec.yaml not same as in flutter --version

I'm trying to set environment sdk version to a higher number but it says that my current SDK is as seen below:
The current Dart SDK version is 2.14.4.
Because demo_app_1 requires SDK version >=2.16.0 <3.0.0, version solving failed.
pub get failed (1; Because demo_app_1 requires SDK version >=2.16.0 <3.0.0, version solving failed.)
exit code 1
When i run flutter --version i get the following:
Flutter 3.1.0-0.0.pre.854 • channel master • https://github.com/flutter/flutter.git
Framework • revision ec20ea80ad (17 hours ago) • 2022-05-21 16:28:06 -0400
Engine • revision 1bfe551d6b
Tools • Dart 2.18.0 (build 2.18.0-142.0.dev) • DevTools 2.13.1
Any help would be much appreciated. Thanks.
See you're confusing two things.
The dart SDK version that's mentioned in pubspec.yaml is for the 'dart'
version to be used in the project, not the flutter version.
Important to note that every dart version is compatible with a corresponding flutter version. The dependency can be loose though.
So in your case Flutter 3.1.0-0.0.pre.854 is the flutter version and 2.18.0 is the dart version. This shows that your flutter 3.1 is compatible with dart 2.18 and is installed, but your project uses 2.14.4
You can check the available list from flutter SDK releases
The problem is that demo_app_1 requires an SDK version >= (higher or equal) 2.16.0 but < (below) 3.0.0. The version you have installed is 3.1.0, which does not fulfill the requirement.
You have two options:
Change your flutter installation version
flutter downgrade <version>
flutter doctor
Change the required SDK version in your pubspec.yaml
Change the environment->sdk value
flutter pub get
After that, the issue should be resolved.
Run flutter downgrade 3.0.0 and check if solved

Flutter SDK not matching in pubspec.yaml

I am having some errors with my flutter project as seen below.
I tried flutter upgrade, flutter clean, nothing is working to solve this issue.
Output from flutter pub get:
flutter pub get
Running "flutter pub get" in demo_app_1...
The current Dart SDK version is 2.14.4.
Because demo_app_1 depends on cloud_firestore >=3.1.10 which requires SDK version >=2.16.0 <3.0.0, version solving failed.
pub get failed (1; Because demo_app_1 depends on cloud_firestore >=3.1.10 which requires SDK version >=2.16.0 <3.0.0, version solving failed.)
exit code 1
flutter --version in terminal :
flutter --version
Flutter 3.1.0-0.0.pre.847 • channel master • https://github.com/flutter/flutter.git
Framework • revision 7459332538 (61 minutes ago) • 2022-05-21 02:33:07 -0400
Engine • revision 0264282e8b
Tools • Dart 2.18.0 (build 2.18.0-139.0.dev) • DevTools 2.13.1\
Thank you for your help.
in the pubspec.yaml you define the flutter sdk version (detailed information see here: Flutter and the pubspec file)
your importent part is the
environment:
sdk: ">=2.7.0 <3.0.0"
here you define the sdk version and like the error message says, cloud_firestore requires a SDK version between 2.16.0 and 3.0.0
so you have to adjust these version to reach the requirements

problem with dart-sdk from within flutter

I run flutter upgrade and and I got the following message
C:\Users\lenovo\IdeaProjects\simple>flutter upgrade
Flutter is already up to date on channel stable
Flutter 2.5.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 18116933e7 (3 weeks ago) • 2021-10-15 10:46:35 -0700
Engine • revision d3ea636dc5
Tools • Dart 2.14.4
but when I try to upgrade the packages including the riverpod which has got to the stable release today
I got the following message
The current Dart SDK version is 2.13.4.
Because simple depends on flutter_riverpod >=1.0.0 which requires SDK version >=2.14.0 <3.0.0, version solving failed.
pub get failed (1; Because simple depends on flutter_riverpod >=1.0.0 which requires SDK version >=2.14.0 <3.0.0, version solving failed.)
I when check the dart sdk in the setting of the editor I'm currently using, the dart sdk is of version 2.13.4
anyone know how to fix this issue ??
Try removing the versions, keep only the dependency names in pubspec.yaml . Then run flutter pub get. It will automatically download all compatible versions.

incompatibale Dart SDK version in flutter --version and when running a project

i'm a flutter starter and currntly adding firebase authentication to my project.
i added firebase_auth and and cloud_firestore to pubspec.yaml file using command lines
flutter pub add firebase_auth
flutter pub add cloud_firestore
dependenices are
"cupertino_icons: ^1.0.2
cloud_firestore: ^2.0.0
firebase_auth: ^1.1.3"
when trying to run my project i'm getting the error
The current Dart SDK version is 2.12.0-133.2.beta.
Because firebase_auth 1.1.3 requires SDK version >=2.12.0 <3.0.0 and no versions of firebase_auth match >1.1.3 <2.0.0, firebase_auth ^1.1.3 is forbidden.
So, because elected_ones depends on firebase_auth ^1.1.3, version solving failed.
pub get failed (1; So, because elected_ones depends on firebase_auth ^1.1.3, version solving failed.)
in the error it says the Dart SDK version is 2.12.0-133.2.beta
but when i run flutter --version i get
Flutter 2.0.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 1d9032c7e1 (8 days ago) • 2021-04-29 17:37:58 -0700
Engine • revision 05e680e202
Tools • Dart 2.12.3
being trying to figure it out and i got totally lost between the '''dart pub upgrade''' and '''dart pub outdated''' through transitive dependecies
problem solved by directing the IDE to correct folder where correct sdk sits
run in terminal (in project root)
flutter doctor -v
path will be shown in the first line

Flutter lower dart version

I'm getting the following error due to Dart version of my flutter setup when I run the flutter get packages command:
[project_name] flutter packages get Running "flutter packages get"
in project_name...
The current Dart SDK version is
2.1.0-dev.0.0.flutter-be6309690f.
Because project depends on intl_translation >=0.14.0+1 <0.17.0 which
requires SDK version >=1.12.0 <2.0.0, version solving failed. pub get
failed (1) exit code 1
My framework version:
Flutter 0.6.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 9299c02cf7 (2 weeks ago) • 2018-08-16 00:35:12 +0200
Engine • revision e3687f70c7
Tools • Dart 2.1.0-dev.0.0.flutter-be6309690f
I would like to learn if there's some kind of command to lower dart-sdk version of the flutter framework, thanks in advance.
In the Flutter install directory execute
git checkout v"0.5.0" // for example
You can check which versions are available in the Flutter GitHub repository https://github.com/flutter/flutter
You can only change the Dart version if you change to a Flutter version that contains the desired Dart version.
Change the dependency to
dev_dependencies:
intl_translations: ^0.17.0
Add following dependency in pubspec.yaml file
version: 1.0.0+1
environment:
sdk: ">=2.0.0-dev.68.0 <3.0.0"