Flutter 当我向依赖项添加新包时,flatter pub get失败
当我尝试向依赖项添加flatter\u audio\u recorder:^0.5.5时,在我按下“pub get”后我面临着下面这样的错误我如何解决它有人能帮我度过美好的一天吗 公开发行Flutter 当我向依赖项添加新包时,flatter pub get失败,flutter,Flutter,当我尝试向依赖项添加flatter\u audio\u recorder:^0.5.5时,在我按下“pub get”后我面临着下面这样的错误我如何解决它有人能帮我度过美好的一天吗 公开发行 名称:lezzet_kitabi 描述:一个新的颤振应用。 #以下行可防止将包意外发布到 #pub.dev使用“pub publish”。这是私人软件包的首选。 发布到:“无”#如果要发布到pub.dev,请删除此行 #下面定义了应用程序的版本和内部版本号。 #版本号是由点分隔的三个数字,如1.2.43 #后
名称:lezzet_kitabi
描述:一个新的颤振应用。
#以下行可防止将包意外发布到
#pub.dev使用“pub publish”。这是私人软件包的首选。
发布到:“无”#如果要发布到pub.dev,请删除此行
#下面定义了应用程序的版本和内部版本号。
#版本号是由点分隔的三个数字,如1.2.43
#后跟可选的内部版本号,以+分隔。
#版本和制造商编号都可能在颤振中被覆盖
#通过分别指定--build name和--build number来生成。
#在Android中,版本名用作版本名,而版本号用作版本代码。
#更多关于Android版本控制的信息,请访问https://developer.android.com/studio/publish/versioning
#在iOS中,生成名称用作CbundleShortVersionString,而生成编号用作CbundLeverVersion。
#阅读有关iOS版本控制的更多信息,请访问
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
版本:1.0.0+1
环境:
sdk:“>=2.7.0
您可以为vs代码安装上述扩展,并通过该扩展重写依赖项
错误的原因是,如果您的所有依赖项都有相同的软件包,则它们必须依赖于其他软件包的类似版本。您的软件包flatter\u audio\u recorder
取决于文件软件包版本5.0.4,但同时您的流程软件包取决于文件版本6.0.0.现在,由于两者同时使用,一个软件包需要5.0.4版,另一个软件包需要6.0.0版的文件
软件包“,您将得到一个错误。您可以阅读文档,了解工作所需的其他软件包的版本,并降级其中一个软件包的版本,错误将得到解决
因为有书面规定,flatter\u音频记录器的“每个版本”取决于文件
版本5.0.4。我认为您应该添加另一个名为process
的包,并添加一个降级版本,可能是3.0.0或3范围内的某个版本,它可能会解决您的问题
类似的“冲突”也发生在其他软件包之间。您可以通过更改其版本来解决此问题
几天前我也遇到了类似的问题,这件事对我很有效
name: lezzet_kitabi
description: A new Flutter application.
# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
bordered_text: ^1.0.1
sqflite: ^2.0.0+2
path_provider: ^2.0.1
provider: ^5.0.0
camera: 0.5.8+17
image_picker: ^0.7.2
path: ^1.8.0
vibration: ^1.7.3
holding_gesture: ^0.0.3
flutter_audio_recorder: ^0.5.5
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:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- images/logoBGopacity.png
- images/logoBG.png
- images/cuttedlogo.PNG
- images/sticker0.png
- images/sticker1.png
- images/sticker2.png
- images/sticker3.png
- images/sticker4.png
- images/sticker5.png
- images/sticker6.png
- images/sticker7.png
- images/sticker8.png
- images/sticker9.png
- images/sticker10.png
- images/sticker11.png
- images/sticker12.png
- images/sticker13.png
- images/sticker14.png
- images/sticker15.png
- images/sticker16.png
- images/sticker17.png
- images/sticker18.png
- images/sticker19.png
- images/sticker20.png
- images/sticker21.png
- images/sticker22.png
- images/stickerForRecipeScreen.png
fonts:
- family: Marck
fonts:
- asset: fonts/MarckScript-Regular.ttf
- family: Graduate
fonts:
- asset: fonts/Graduate-Regular.ttf
- family: OpenSans
fonts:
- asset: fonts/OpenSansCondensed-Light.ttf
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
Because every version of flutter_audio_recorder depends on file ^5.0.4 and process >=4.0.0 depends on file ^6.0.0, flutter_audio_recorder is incompatible with process >=4.0.0.
And because xdg_directories 0.2.0 depends on process ^4.0.0 and no versions of xdg_directories match >0.2.0 <0.3.0, flutter_audio_recorder is incompatible with xdg_directories ^0.2.0.
And because path_provider_linux 2.0.0 depends on xdg_directories ^0.2.0 and no versions of path_provider_linux match >2.0.0 <3.0.0, flutter_audio_recorder is incompatible with path_provider_linux ^2.0.0.
And because path_provider 2.0.1 depends on path_provider_linux ^2.0.0 and no versions of path_provider match >2.0.1 <3.0.0, flutter_audio_recorder is incompatible with path_provider ^2.0.1.
So, because lezzet_kitabi depends on both path_provider ^2.0.1 and flutter_audio_recorder ^0.5.5, version solving failed.
pub get failed (1; So, because lezzet_kitabi depends on both path_provider ^2.0.1 and flutter_audio_recorder ^0.5.5, version solving failed.)