安装颤振包时获取包版本冲突
Posted
技术标签:
【中文标题】安装颤振包时获取包版本冲突【英文标题】:Getting package version conflicts while installing flutter packages 【发布时间】:2021-10-02 08:10:16 【问题描述】:我正在尝试在 pubspec.yaml 中安装包 jitsi_meet: ^4.0.0,当我安装时,安装终止时出现此错误
Because jitsi_meet >=4.0.0 depends on jitsi_meet_platform_interface ^2.0.0 which depends on plugin_platform_interface ^2.0.0, jitsi_meet >=4.0.0 requires plugin_platform_interface ^2.0.0.
And because firebase_storage_platform_interface 1.0.4 depends on plugin_platform_interface ^1.0.0 and no versions of firebase_storage_platform_interface match >1.0.4 <2.0.0, jitsi_meet >=4.0.0 is incompatible with firebase_storage_platform_interface ^1.0.4.
And because firebase_storage 7.0.0 depends on firebase_storage_platform_interface ^1.0.4 and no versions of firebase_storage match >7.0.0 <8.0.0, jitsi_meet >=4.0.0 is incompatible with firebase_storage ^7.0.0.
So, because edaffix depends on both firebase_storage ^7.0.0 and jitsi_meet ^4.0.0, version solving failed.
pub get failed (1; So, because edaffix depends on both firebase_storage ^7.0.0 and jitsi_meet ^4.0.0, version solving failed.)
exit code 1
我的 pubspec.yaml 文件是
version: 1.1.1+3
environment:
sdk: '>=2.6.0 <3.0.0'
dependencies:
flutter:
sdk: flutter
firebase_core: '^0.7.0'
firebase_auth: '^0.20.1'
firebase_crashlytics: '^0.4.0+1'
cloud_firestore: '^0.16.0+1'
cloud_functions: '^0.9.0'
firebase_storage: '^7.0.0'
firebase_messaging: '^8.0.0-dev.15'
cached_network_image: ^2.0.0
timeago: ^2.0.26
shared_preferences: ^0.5.6+3
carousel_slider: ^1.4.1
video_player: ^0.10.11+1
chewie: ^0.9.10
image_cropper: ^1.2.3
image_picker: ^0.6.7+2
flutter_offline: '^0.3.0'
percent_indicator: '^2.1.5'
jitsi_meet: ^4.0.0
jiffy: ^3.0.1
intl: ^0.16.1
flutter_datetime_picker: ^1.3.8
timeline_tile: ^1.0.0
flutter_full_pdf_viewer: ^1.0.6
# 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
# 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.
flutter:
uses-material-design: true
我尝试安装 plugin_platform_interface: '^1.0.0
作为额外的依赖项,但无法正常工作。
请帮我解决这个问题。
【问题讨论】:
【参考方案1】:您可以将jitsi_meet
包降级到版本^2.1.0
,错误应该会消失。
我通过以下方式获得版本号:
-
将
jitsi_meet
版本留空,如下所示:
jitsi_meet:
这使得 pub 获得包的最佳兼容版本。
-
在
pubspec.lock
文件中搜索jitsi_meet
。在那里我看到了这个代码块:
jitsi_meet:
dependency: "direct main"
description:
name: jitsi_meet
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
这意味着pub
将版本号解析为2.1.0
-
在
pubspec.yaml
文件中指定版本号,如下所示:
jitsi_meet: ^2.1.0
【讨论】:
以上是关于安装颤振包时获取包版本冲突的主要内容,如果未能解决你的问题,请参考以下文章