flutter_session and shared_preferences not work together in flutter? - android

Because hr depends on flutter_session ^0.1.1 which depends on shared_preferences ^0.5.8, shared_preferences ^0.5.8 is required.
So, because hr depends on shared_preferences ^2.0.4, version solving failed.
pub get failed (1; So, because hr depends on shared_preferences ^2.0.4, version solving failed.) Process finished with exit code 1
my pubspec.yaml code
dependencies:
flutter:
sdk: flutter
flutter_session: ^0.1.1
shared_preferences: ^2.0.4
how to overcome it?

flutter_session: ^0.1.1 depends on dart sdk 2.7.0 whilst shared_preferences: ^2.0.4 depends on dart sdk 2.12, hence the error.
you might have to use this pull request for flutter_session which is updated to flutter 2.0 and latest dart sdk
https://github.com/jhourlad/flutter_session/pull/11
in pubspec.yaml
flutter_session:
git:
url: https://github.com/RomanIvn/flutter_session.git
ref: master

Related

Flutter ImagePicker library cannot be found

Im trying to implement ImagePicker to my Flutter project but when i try to import the package: import 'package:image_picker/image_picker.dart'; it only shows error. I have added it to my pubspec.yaml file as a dependecie but it displayed this error when I reopened the VS:
Because LPP requires SDK version >=2.12.0 <3.0.0, version solving failed.
pub get failed (1; Because LPP requires SDK version >=2.12.0 <3.0.0, version solving failed.)
exit code 1
This is my pubspec.ymal file:
version: 1.0.0+1
environment:
sdk: ">=2.12.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: ^1.0.0
image_picker: ^0.7.2+1
So any help would be great. Thanks in advance :) <3
Which flutter- and dart-version shows "flutter doctor -v"?
Your sdk has to be >= 2.12
If you don't use flutter 2 with dart 2.12 than upgrade flutter (I have currently massive problem with this) or downgrade the versions of sdk, Cupertino-icons and image-picker in the pubspec.yaml-file
Ok so I changed version from 7.2+1 to 6.2 and now it works. :)

How to upgrade http dependency in Android Studio

flutter pub get:
Because firebase_auth >=1.0.0 depends on firebase_auth_web ^1.0.0 which depends on http_parser ^4.0.0, firebase_auth >=1.0.0 require
s http_parser ^4.0.0.
And because http 0.12.2 depends on http_parser >=0.0.1 <4.0.0 and no versions of http match >0.12.2 <0.13.0, firebase_auth >=1.0.0 i
s incompatible with http ^0.12.2.
So, because p1 depends on both http ^0.12.2 and firebase_auth ^1.0.0, version solving failed.
Running "flutter pub get" in p1...
pub get failed (1; So, because p1 depends on both http ^0.12.2 and firebase_auth ^1.0.0, version solving failed.)
I just ran flutter upgrade so my flutter and dart packages are up to date, and through sdk manager (in tools) I have android 10 and 11 installed along with required sdk tools. Android studio has no pending updates for dev channel. (5th March, 2021)
The firebase versions were included just yesterday.
dependencies:
http: "^0.12.2"
flutter:
sdk: flutter
cupertino_icons: ^1.0.0
firebase_core: ^1.0.0
firebase_auth: ^1.0.0
firebase_database: ^6.1.0
I apologize if I am missing something right under my nose.
Edit: Yes, I totally missed it. I just had to look up http in pub.get then change the version. (latest: http: "^0.13.0") Please delete this if required.
Solution: I changed the version of http in dependencies (pubspec.yaml) from the older version to http: "^0.13.0" (latest as of 5th March 2021) (get the version from pub.dev and type in http, go to installing tab, and you'll find the version there).
Then run flutter pub get, or whatever suits your needs.
My current dependencies:
dependencies:
http: "^0.13.0"
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.0
firebase_core: ^1.0.0
firebase_auth: ^1.0.0
firebase_database: ^6.1.0
If anyone else wants to share anything related, please do! Thank you.

when i run flutter pub get i get this error "date_picker_timeline" depends on intl ^0.16.0 and "flutter_localizations" depends on intl 0.17.0

Because date_picker_timeline >=1.1.0 depends on intl ^0.16.0 and every version of flutter_localizations from sdk depends on intl 0.17.0, date_picker_timeline >=1.1.0 is incompatible with flutter_localizations from sdk.
And because easy_localization >=2.1.0+1 depends on flutter_localizations any from sdk, date_picker_timeline >=1.1.0 is incompatible with easy_localization >=2.1.0+1.
So, because TimyTimeMain depends on both date_picker_timeline ^1.1.3 and easy_localization ^2.3.3, version solving failed.
intl: ">=0.16.0 <=0.17.0-nullsafety.2"
easy_localization: ^2.3.3
date_picker_timeline: ^1.1.3
the Date Picker has a new version -
dependencies:
date_picker_timeline: ^1.2.1
https://pub.dev/packages/date_picker_timeline/install
Please update this data in your pubspec.yaml
Also, you can check the version for the Intl package and others if necessary
https://pub.dev/packages/intl/install

Flutter localization and sdk may be incompatible

Here is my Error
Pub get givig this error
Running "flutter pub get" in flutter_application...
Because google_map_location_picker >=3.3.1 <4.1.3 depends on intl >=0.16.0 <=0.16.1 and every version of flutter_localizations from sdk depends on intl 0.17.0, google_map_location_picker >=3.3.1 <4.1.3 is incompatible with flutter_localizations from sdk.
So, because markets depends on both flutter_localizations any from sdk and google_map_location_picker 4.0.0, version solving failed.
pub get failed (1; So, because markets depends on both flutter_localizations any from sdk and google_map_location_picker 4.0.0, version solving failed.)
Process finished with exit code 1
You can override the dependency using dependency_overrides in your pubspec.yaml
Example
dependency_overrides:
intl: ^0.16.0
dependencies:
flutter:
sdk: flutter
//your other dependance

built_value has a dependency conflict with flutter_test

I'm trying to fetch JSON data using built_value serializer but after setting built_value package in yaml file getting an error like:
Because built_value_generator >=5.5.3 depends on analyzer ^0.32.1 and
every version of flutter_test from sdk depends on analyzer
0.31.2-alpha.2, built_value_generator >=5.5.3 is incompatible with flutter_test from sdk. So, because tornado_blog_flutter depends on
both flutter_test any from sdk and built_value_generator ^5.5.3,
version solving failed. pub get failed
How to solve this error?
My yaml file:
name: flutter_layout
description: A new Flutter application.
dependencies:
flutter:
sdk: flutter
built_collection: '>=2.0.0 <4.0.0'
built_value: ^5.5.3
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
dev_dependencies:
flutter_test:
sdk: flutter
json_serializable: ^0.5.0
build_runner: ^0.9.0
built_value_generator: ^5.5.3
There's some info on this issue here. The version of analyzer used by Flutter needs to be upgraded to solve this.
There's an open issue in Flutter to this here but it doesn't seem to have been done yet.
As a workaround, you could try going back to an earlier version of built_value that doesn't require such a new version of the analyzer.

Categories

Resources