Flutter - flutter_localizations incompatible with json_schema - flutter

I am trying to add json_schema in my pubspec.yaml but when I run flutter pub get I end up with the following errors:
The current Dart SDK version is 2.7.0.
Because sockjs_client_wrapper >=1.0.14 depends on w_common ^1.20.1 and sockjs_client_wrapper >=1.0.5 <1.0.14 depends on w_common ^1.9.0, sockjs_client_wrapper >=1.0.5 requires w_common ^1.9.0.
And because w_common >=0.2.0 <1.15.0 requires SDK version >=1.12.0 <2.0.0, sockjs_client_wrapper >=1.0.5 requires w_common ^1.15.0.
Because every version of flutter_localizations from sdk depends on intl 0.16.0 and w_common >=1.15.0 depends on intl >=0.14.0 <0.16.0, flutter_localizations from sdk is incompatible with w_common >=1.15.0.
Thus, flutter_localizations from sdk is incompatible with sockjs_client_wrapper >=1.0.5.
And because json_schema >=2.0.1 depends on w_transport ^3.2.8 which depends on sockjs_client_wrapper ^1.0.5, flutter_localizations from sdk is incompatible with json_schema >=2.0.1.
So, because esiquizz depends on both json_schema ^2.2.1 and flutter_localizations any from sdk, version solving failed.
Running "flutter pub get" in esiquizz...
pub get failed (1; So, because esiquizz depends on both json_schema ^2.2.1 and flutter_localizations any from sdk, version solving failed.)
I understand that it is a problem of versions with flutter_localisations but I don't known how to solve it. Is there a way to use both flutter_localisations and json_schema ?
flutter_localizations
json_schema
This is my pubspec.yaml:
environment:
sdk: ">=2.3.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
json_schema: ^2.2.1 #<==================================
flutter_localizations: #<===============================
sdk: flutter #<=======================================
cupertino_icons: ^0.1.2
firebase_core: ^0.4.0+9
firebase_analytics: ^5.0.2
firebase_auth: ^0.14.0+5
cloud_firestore: ^0.12.9+5
firebase_crashlytics: ^0.1.0+3
cloud_functions: ^0.4.1+4
dartz: ^0.8.7
get_it: ^3.0.3
flutter_bloc: ^2.0.0
equatable: ^0.6.1
mdi: ^0.2.2
provider: ^3.1.0+1
shared_preferences: ^0.5.4+3
sembast: ^2.1.0+1
path_provider: ^1.4.0
tuple: ^1.0.3
file_picker: ^1.4.2+1

Maybe you can fix it with
dependency_overrides:
json_schema: ^2.2.1

Related

Can't install permission_handler and file_picker because of cloud_firestore

I want to get data from Firestore, put it into a list and enable to user to download data on phone in CSV format by using app.
I found two solutions how to export data to CSV file on phone, but both solutions contains packages which I can't install.
Solution #1
How to create and export csv file in flutter?
Dependencies #1
dependencies:
page_view_indicators: ^2.0.0
syncfusion_flutter_xlsio: ^19.1.64-beta
csv: ^5.0.0
ext_storage: ^1.0.3
permission_handler: ^8.0.0+1
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
Problem #1
Because cloud_firestore >=0.13.1 <0.14.0-dev.1 depends on cloud_firestore_platform_interface ^1.0.0 which depends on plugin_platform_interface ^1.0.0, cloud_firestore >=0.13.1 <0.14.0-dev.1 requires plugin_platform_interface ^1.0.0.
And because permission_handler >=8.0.0 depends on permission_handler_platform_interface ^3.5.0 which depends on plugin_platform_interface ^2.0.0, cloud_firestore >=0.13.1 <0.14.0-dev.1 is incompatible with permission_handler >=8.0.0.
So, because gamiforms depends on both permission_handler ^8.0.0+1 and cloud_firestore ^0.13.3, version solving failed.
pub get failed (1; So, because gamiforms depends on both permission_handler ^8.0.0+1 and cloud_firestore ^0.13.3, version solving failed.)
exit code 1
Solution #2
https://medium.com/flutterdevs/exploring-csv-in-flutter-fafc57b02eb1
Dependencies #2
dependencies:
page_view_indicators: ^2.0.0
syncfusion_flutter_xlsio: ^19.1.64-beta
csv: ^5.0.0
ext_storage: ^1.0.3
file_picker: ^3.0.1
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
Problem #2
Because cloud_firestore >=0.13.1 <0.14.0-dev.1 depends on cloud_firestore_platform_interface ^1.0.0 which depends on plugin_platform_interface ^1.0.0, cloud_firestore >=0.13.1 <0.14.0-dev.1 requires plugin_platform_interface ^1.0.0.
And because file_picker >=3.0.0-nullsafety.3 depends on plugin_platform_interface ^2.0.0, cloud_firestore >=0.13.1 <0.14.0-dev.1 is incompatible with file_picker >=3.0.0-nullsafety.3.
So, because gamiforms depends on both file_picker ^3.0.1 and cloud_firestore ^0.13.3, version solving failed.
pub get failed (1; So, because gamiforms depends on both file_picker ^3.0.1 and cloud_firestore ^0.13.3, version solving failed.)
exit code 1
How to fix one of these problems or is there any another way how to export data to phone via app?
I've never done this before and every advice is welcome.
EDIT
dev_dependencies:
flutter_test:
sdk: flutter
cached_network_image: ^2.0.0
cloud_firestore: ^0.13.3
firebase_auth: ^0.15.2
provider: ^3.2.0
#google_sign_in: ^4.1.1
shared_preferences: ^0.5.6+3
random_string: ^2.0.1
In both the cases, you cloud_firestore is way too old. I see that the current version is
cloud_firestore: ^2.2.0
So, unless there is some problem with this version, you should migrate it to the latest version, which should be depending on a later version of plugin_platform_interface
cloud_firestore: ^2.2.0 depends on cloud_firestore_platform_interface: ^5.1.0 which depends on plugin_platform_interface: ^2.0.0.
So, change your pubsec.yaml file to have,
cloud_firestore: ^2.2.0
Then run, flutter pub get.

How to resolve the 3rd party plugin conflicts in Flutter?

This is a part of my pubspec.yaml file
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
http: ^0.13.3
syncfusion_flutter_calendar: ^18.4.47
flutter_chat_bubble: ^1.0.2
intl: ^0.17.0
flutter_local_notifications: ^4.0.1+2
provider: ^5.0.0
sqflite_sqlcipher: ^2.0.0
logging: ^1.0.1
grouped_list: ^3.5.0
visibility_detector: ^0.1.5
smart_select: ^4.3.2
dropdown_search: ^0.5.0
synchronized: ^3.0.0
local_auth: ^1.1.5
font_awesome_flutter: ^9.0.0
lite_rolling_switch: ^0.1.1
flutter_webview_plugin: ^0.3.11
email_validator: ^1.0.6
package_info: ^2.0.0
connectivity: ^3.0.3
device_info: ^2.0.0
encrypt: ^5.0.0
flutter_html: ^1.3.0
url_launcher: ^6.0.2
flutter_inappwebview: ^5.3.2
signalr_core: ^1.1.1
When I try to run the app I get this error
Running "flutter pub get" in mobile_app1...
Because no versions of signalr_core match >1.1.1 <2.0.0 and signalr_core 1.1.1 depends on tuple ^2.0.0, signalr_core ^1.1.1 requires tuple ^2.0.0.
And because no versions of tuple match >2.0.0 <3.0.0 and tuple 2.0.0 depends on quiver ^3.0.0, signalr_core ^1.1.1 requires quiver ^3.0.0.
And because flutter_layout_grid 0.10.5 depends on quiver ^2.0.0 and no versions of flutter_layout_grid match >0.10.5 <0.11.0, signalr_core ^1.1.1 is incompatible with flutter_layout_grid ^0.10.5.
And because flutter_html 1.3.0 depends on flutter_layout_grid ^0.10.5 and no versions of flutter_html match >1.3.0 <2.0.0, signalr_core ^1.1.1 is incompatible with flutter_html ^1.3.0.
So, because mobile_app1 depends on both flutter_html ^1.3.0 and signalr_core ^1.1.1, version solving failed.
pub get failed (1; So, because mobile_app1 depends on both flutter_html ^1.3.0 and signalr_core ^1.1.1, version solving failed.)
I solved this problem by adding this in my pubspec.yaml file
dependency_overrides:
quiver: ^3.0.0
Is there any better way to resolve this conflict?
Set them all toany, then run flutter pub get.
Now you can look in the pubspec.lock file and see what versions you got and put them in pubspec.yaml.

Conflict with using firebase_auth and flutter_localizations packages

The packages firebase_auth and flutter_localizations cause the following error. Is there a way to fix this?
Because firebase_auth >=0.20.1 <0.21.0-1.0.nullsafety.0 depends on firebase_auth_web ^0.3.3 and no versions of firebase_auth match >0.20.0+1 <0.20.1, firebase_auth >0.20.0+1 <0.21.0-1.0.nullsafety.0 requires firebase_auth_web ^0.3.3.
And because firebase_auth 0.20.0+1 depends on firebase_auth_web ^0.3.2+6, firebase_auth >=0.20.0+1 <0.21.0-1.0.nullsafety.0 requires firebase_auth_web ^0.3.2+6.
And because firebase_auth_web >=0.3.0-dev.1 <0.4.0-1.0.nullsafety.0 depends on intl ^0.16.1 and every version of flutter_localizations from sdk depends on intl 0.17.0, firebase_auth >=0.20.0+1 <0.21.0-1.0.nullsafety.0 is incompatible with flutter_localizations from sdk.
So, because geschenk depends on both flutter_localizations any from sdk and firebase_auth ^0.20.0+1, version solving failed.
pub get failed (1; So, because geschenk depends on both flutter_localizations any from sdk and firebase_auth ^0.20.0+1, version solving failed.)
I managed to fix this issue by adding the following lines to override the dependencies:
dependency_overrides:
intl: ^0.17.0-nullsafety.2
My dependencies now look like this:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
firebase_core: ^0.7.0
firebase_auth: ^0.20.1
dependency_overrides:
intl: ^0.17.0-nullsafety.2
You can try this:
dependencies:
firebase_auth_web: 0.3.3
firebase_auth: ^0.20.1
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
intl:^0.17.0-nullsafety.2

Error in setting up flutter_localizations package

I need to add flutter_localizations package to use Arabic language in my application, but when I add it in pubspec.yaml, it gives me the following error:
Because calendar_timeline >=0.6.1 depends on intl ^0.16.1 and every version of flutter_localizations from sdk depends on intl 0.17.0-nullsafety.2, calendar_timeline >=0.6.1 is incompatible with flutter_localizations from sdk.
So, because elderly_app depends on both flutter_localizations any from sdk and calendar_timeline ^0.7.0, version solving failed.
pub get failed (1; So, because elderly_app depends on both flutter_localizations any from sdk and calendar_timeline ^0.7.0, version solving failed.)
This is my pubspec.yaml:
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
cupertino_icons: ^1.0.1
calendar_timeline: ^0.7.0
flutter_datetime_picker: ^1.5.0
date_picker_timeline: ^1.2.1
hijri: ^2.0.3
flutter_week_view: ^1.0.0+2
url_launcher: ^5.7.10
It works when I delete the lines under flutter_localizations like cupertino_icons and calendar_timeline
According to the above message you should decrease your calendar_timeline version to lower than 0.6.1. for example calendar_timeline: 0.6.0
and add this line to pubspec.yaml file:
dependency_overrides:
intl: ^0.16.0
Try updating all of your packages to the latest version.

pub get failed:version solving failed

Flutter_test depends on meta 1.1.8 and firebase_login depends on meta ^1.2.2.
firebase_login depends on flutter_test any from sdk, version solving failed.
pub get failed
pubspec.yaml
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
firebase_auth: ^0.18.0+1
equatable: ^1.2.4
google_sign_in: ^4.5.3
meta: ^1.2.2
cupertino_icons: ^0.1.3
dev_dependencies:
flutter_test:
sdk: flutter
lint: any
You can get both by
dependencies:
meta: ^1.2.2
dependency_overrides:
meta: ^1.1.8
I have same problem with bloc:
Because every version of passcode_navigator from git depends on flutter_bloc ^7.3.3 and every version of feature_menu from path depends on flutter_bloc ^8.0.0, passcode_navigator from git is incompatible with feature_menu from path
I resolve it with adding to pubspec:
dependency_overrides:
flutter_bloc: any
Do this,
meta: ^1.1.8
And then, run this,
flutter pub get
hi there try to downgrade the version of meta to 1.1.8 i tried and it worked with me in flutter 1.20.1
I experienced a similar issue with Firebase auth and permission_handler:
# pubspec.yaml:
dependencies:
flutter:
sdk: flutter
firebase_auth: ^1.4.1
permission_handler: ^5.1.0+2
The error message (truncated):
Because permission_handler ^5.1.0 depends on permission_handler_platform_interface ^2.0.2 which depends on plugin_platform_interface ^1.0.2, permission_handler ^5.1.0 requires plugin_platform_interface ^1.0.2.
And because firebase_auth 1.4.1 depends on firebase_core_platform_interface ^4.0.1 and no versions of firebase_auth match >1.4.1 <2.0.0, permission_handler ^5.1.0 is incompatible with firebase_auth ^1.4.1.
So, because my_flutter_project depends on both firebase_auth ^1.4.1 and permission_handler ^5.1.0+2, version solving failed.
A solution that worked for me:
Update permission_handler to the latest version:
flutter pub add permission_handler
Update meta to 1.2.2
meta: ^1.2.2
also update flutter using flutter upgrade command
flutter upgrade