我试图在我的pubspec.yaml中添加json_schema,但是当我运行flutter pub get时,我得到了以下错误:
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.)我知道这是一个flutter_localisations版本的问题,但我不知道如何解决它。有没有办法同时使用flutter_localisations和json_schema?
这是我的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发布于 2020-04-02 11:03:56
也许你可以用以下命令来修复它
dependency_overrides:
json_schema: ^2.2.1https://stackoverflow.com/questions/58989815
复制相似问题